Macros don't work if I "Save As" with different name

Domroy

Board Regular
Joined
Mar 8, 2018
Messages
114
I'm sorry, I'm new to writing macros. I'm ok with recording them, but writing is different. I have some macros in a workbook, and if I save it as a different workbook, it won't find the macros when I've assigned them Quick Access Toolbar shortcuts.

I must be missing some code somewhere...thoughts? Do you need to see the code? It's somewhat rudimentary, so I'm a little embarrassed! LOL
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I'm sorry, I'm new to writing macros. I'm ok with recording them, but writing is different. I have some macros in a workbook, and if I save it as a different workbook, it won't find the macros when I've assigned them Quick Access Toolbar shortcuts.

I must be missing some code somewhere...thoughts? Do you need to see the code? It's somewhat rudimentary, so I'm a little embarrassed! LOL

If you did not save the new file as a macro enabled workbook (.xlsm) then your macros were deleted by Excel during the SaveAs action.
 
Upvote 0
I do save it as an .xlsm, except I rename it and change the location. Then it tells me it can't find the macros.
 
Upvote 0
If you've changed the name of the file, then you'll need to reset the QAT as the shortcuts will still be pointing to the original file
 
Upvote 0
Hmm...ok. I change the location of the file, but not the name, usually. And it still looks for another path.
 
Upvote 0
Are they getting saved in the personal workbook?
 
Upvote 0
No. I save them in the actual workbook. So, maybe I'm missing an "active workbook" line of code or something?
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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