Macros on customize ribbon

caselton

New Member
Joined
Apr 21, 2018
Messages
11
Hi All
I have a query please
I have lots of macros on program ive made for work, and i noticed that i could add a link to run the macros on the ribbon, which is brilliant
However, as i have a master macro enabled -file and whenever i use the design spreadsheet for a new project i save as.
But when i press the button to run the macro on the new saved as version, it keeps trying to open the original master file and its not workable like this.

Is there a way to ensure that the command buttons on the ribbon run the macros in the workbook that is open only please
(or effectively unlink it from the original)

Many thanks in advance
Jason
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

rondeondo

Board Regular
Joined
Aug 15, 2012
Messages
188
Office Version
  1. 365
Platform
  1. Windows
Hi Jason
When you add a button to the ribbon for a macro it is attached to the file it sits in at the time of adding. If you save the macro file as another file it leaves the buttons as they were. I have a similar situation, I have one file with all my macros in it and I have it saved as an add-in, xlam, file and I have it added as an addin to be opened when excel opens.
Simplest thing is to keep the same filename for your macros. Save versions as you need but keep the one you use with the same name.

If you want to update the file you refer to for the macros there's a fairly simple way.
When you're customising the ribbon you can export your customisations. Do this, the export is an xml file.
You can then open the export in notepad and search/replace the old macro filename for new
then import the customisations and your buttons will point to the new file.
 

Forum statistics

Threads
1,148,241
Messages
5,745,579
Members
423,962
Latest member
PisaTorauh

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
Top