Custom Ribbon Macros point to old workbook

missingsc

New Member
Joined
Mar 14, 2024
Messages
23
Office Version
  1. 365
Platform
  1. Windows
  2. Web
I've created a workbook with several coded macros of which I've assigned to buttons in a custom Ribbon tab for the workbook. When I am coding new macros or changing code, I make a copy of the workbook and do it in the new copy so as to not corrupt the current version in case I make a mistake, etc. The problem I run into is that when I do this, all the Ribbon buttons when clicked pull up the old workbook and they get run in the old workbook, not the newly copied one.

From researching, I found that I can resolve the issue by redoing all the buttons in the Ribbon to select the macro name for the new workbook I copied. My question to you all is: can I do something in my macros, workbook, etc. so that I do not have to do this each time and the Ribbon buttons always point to the macros within its workbook, not the previous one I copied from? I would like to distribute this workbook to others but I'm concerned they will get the same problem and/or not be able to see the Ribbon buttons/macros.

Thanks in advance for your help!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Your custom buttons were created by customizing the ribbon in Excel, right? Unfortunately, the buttons are pointed to that workbook

The best solution for this is to create a custom ribbon for that workbook by editing the UI directly. I do this all the time. I use the Custom UI Editor by Microsoft and a PDF that shows all the icons with names and images to insert into the html. Once you do this once, you'll be a pro and it will be much more professional looking. The new tab, groups, and buttons will only be available when that workbook is active and they get copied with no issues of pointing to the old workbook.

If you want I can give you quick tutorial. It's not difficult to find on the internet, but I could make a copy available on my Google Drive once I get home.
 
Upvote 0
Look for: OfficeCustomUIEditorFiles.zip
and
Microsoft-Office-2016_365-imageMso-Gallery.pdf
 
Upvote 0
Your custom buttons were created by customizing the ribbon in Excel, right? Unfortunately, the buttons are pointed to that workbook

The best solution for this is to create a custom ribbon for that workbook by editing the UI directly. I do this all the time. I use the Custom UI Editor by Microsoft and a PDF that shows all the icons with names and images to insert into the html. Once you do this once, you'll be a pro and it will be much more professional looking. The new tab, groups, and buttons will only be available when that workbook is active and they get copied with no issues of pointing to the old workbook.

If you want I can give you quick tutorial. It's not difficult to find on the internet, but I could make a copy available on my Google Drive once I get home.
Apologies for the delayed reply...

I must admit I do not understand what you mean in your post. There's really no way of putting the functions, etc. into a specific module or something that always gets referenced correctly when moving the workbook around?
 
Upvote 0
You can add workbook specific ribbon menus and buttons. These menu tabs and buttons are created inside the workbook and only show themselves when the workbook is open. The buttons refer to the macros inside the VBA project for that workbook. The Custom UI editor from Microsoft allows you to do that. It is very easy to use.
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,595
Members
452,657
Latest member
giadungthienduyen

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