Button "forgetting" Macro Assignment

dkauf

Board Regular
Joined
Sep 23, 2008
Messages
68
I have several buttons in a workbook, each with a unique macro assignment. However, the spreadsheet seems to be forgetting the macros assignments (for all macros) after I save/exit the file.

The next time I open the file and try to run the macro, I get an error "((#REF.xls could not be found)). I even reassign the macro to the button, test that it works, then save/exit and get the same results when I reopen the file.

Any ideas?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
What type of buttons are embedded in the workbook? Are they Forms toolbar buttons, or Control Toolbox buttons? What is macro assignment? Is it within the same workbook, or is it pointing to another workbook?
 
Upvote 0
What type of buttons are embedded in the workbook? Are they Forms toolbar buttons, or Control Toolbox buttons? What is macro assignment? Is it within the same workbook, or is it pointing to another workbook?

The buttons were created using the FORMS toolbar, to which I then assigned a macro that I wrote in VBA in the same workbook. Now, after everytime I close the file and reopen, the buttons return an error, "((#REF.xls' could not be found. Check the spelling of the file name and verify that the file location is correct."

This is weird because I'm not trying to open another file - just run a macro that I can see when I right click on the tabs and select View Code.
 
Upvote 0
That does sound weird. OK, I have one more question, what is the actual filename? ( just in case there is anything unusual about the filename ).
 
Upvote 0
That does sound weird. OK, I have one more question, what is the actual filename? ( just in case there is anything unusual about the filename ).


I've been renaming the file based on revisions that I make along the way. The last name was 'Embrey4'
 
Upvote 0
Can you delete a button, and re-add from the Forms toolbar, reassign the macro, save and close, reopen, and see if it works?

I haven't had this problem before ( plenty of problems with Control Toolbox buttons though ).
 
Upvote 0
I just did as you suggested - deleted the existing button, created a new button and assigned it to the macro "Reset_General", save/exit/reopen and still getting the same problem where the button cannot find the macro assigned to it

For some reason, all of the macros are displayed as "SheetX.Name" even though I did not specficy a Sheet number/name when I created the macro

Could this have anything to do with the problem I am having?
 
Upvote 0
Are you sure that the macro is in a module and not in sheet code?
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top