Can't Run Macro from Add-in Ribbon

mswoods1

Board Regular
Joined
Aug 6, 2010
Messages
60
I have an add-in which I manage. I have two "versions" of the add-in. One is the add-in saved as a workbook and the other is that same workbook, but just saved as an add-in file (".xlam").

I've recently been unable to run some buttons on the ribbon when I have just the add-in file (".xlam") open (and the workbook version closed). The error I get on certain macros is this:

"Cannot run macro 'YourMacro'. The macro may not be available in this workbook or all macros may be disabled."

I've checked and my macros are not disabled. And as I've said, other macros on the ribbon from this same add-in work, it's just a set of macros which seemingly have nothing in common that don't work.

I've found that if I rename the macros that I cannot run, they will work. So, even though the macro 'YourMacro' won't work, if I change the ribbon to call 'YourMacro2" and change the macro name to 'YourMacro2', then it works.

My hypothesis is that somehow Excel is pointing to the workbook version (".xlsm") of the add-in rather than the add-in version (".xlam"). And it's giving me an error since the workbook version is closed. When I have the workbook version open, all of the buttons work. But that's just my guess right now... and even if that's the actual problem, not sure how to fix it.
 
Last edited:
In my case the problem with my file was a missing reference to 'Microsoft Office 12.0 Object Library'
Solution was simply adding the reference in the VBAProject to this Microsoft Office Object Library
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,215,879
Messages
6,127,518
Members
449,385
Latest member
KMGLarson

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