Pages

Monday, March 10, 2025

Buttons won't trigger macros

Problem Description
Clicking the "Clear Data" or "Open Excel File" button does not execute the macros. When we try to reassign the macros, the Excel file cannot be saved, displaying the following error:


Cause of Problem
This happens if the "path and the file name" together exceed 218 characters.

Solution
Shorten the file name or place the file in a folder such that the total length of the path and file name do not exceed 218 characters.

INCORRECT: Too long FilePath or FileName

C:\Users\X\Documents\very-long-path-to-the-excel-file-which-is-more-than-218-characters-due-to-which-the-macros-assigned-to-buttons-do-not-work-this-is-an-example-of-a-very-long-folder-name\Vouchers-V12-Sales-Purchase-With-Stockitems-Advanced.xls

CORRECT: FilePath and FileName are less than 218 characters

C:\Users\X\Documents\myfolder\Vouchers-V12-Sales-Purchase-With-Stockitems-Advanced.xls


No comments: