Pages

Showing posts with label one-drive. Show all posts
Showing posts with label one-drive. Show all posts

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


Wednesday, April 26, 2023

Macro assigned to buttons get removed automatically on reopening Excel file

 Please refer this link wherein the same issue has been discussed: 

Link (copy/paste in browser)
https://techcommunity.microsoft.com/t5/excel/copied-a-macro-enabled-workbook-into-onedrive-now-macros-cannot/m-p/3277944

Notes
From the aforesaid, we understand that you may have to add the ONLINE ONE-DRIVE location to "Trusted locations".

Steps

  1. Start Excel. 
  2. File >> Options >> Trust Center >> Trust Center Settings >> Trusted Locations >> Add new location >> "Add the ONE-DRIVE folder"
  3. Also, check the option "Allow Trusted locations on my network (not recommended)" as suggested in the aforesaid link.