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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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