Cannot run the macro 'XYZ.xlam!Macro'.The macro may ....

JurajM

New Member
Joined
May 4, 2018
Messages
7
Hi All,

I'm trying to run VBA code in .xlsx, when .xlam in AddIns was created. However I'm getting this message, when I try to run it:

Cannot run the macro 'XYZ.xlam!Macro'.The macro may not be available in this workbook or all macros may be disabled.

If I create a module in .xlsx file and paste VBA code into module it runs smoothly.

Any ideas, how this can be fixed?

Thank you in advance.
 
Last edited by a moderator:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Welcome to the forum.

Are you sure the add-in is loaded and that the macro name is correct?
 
Upvote 0
Hi Rory,

Thank you for reply. Yes, real name is BC.xlam and was loaded ( ticked ) in Add-Ins.

So I still do not have idea, why this happening.

Any other ideas?
 
Upvote 0
What is the name of the macro and of the module it is in?
 
Upvote 0
That should be fine then. Can you explain exactly what you mean by this:

I'm trying to run VBA code in .xlsx, when .xlam in AddIns was created.

An xlsx is not a macro enabled file, so I'm not sure exactly what you are doing.
 
Upvote 0
I'm trying to run macro via Add-Ins as starting file is actually report ( usually excel format files which are not supporting macro, but that's why BC.xlam was created as than it shouldn't matter ), from where I'm doing selection from.
If I'm trying to go via Add-Ins it will give me this message:
Cannot run the macro 'BC.xlam!Macro'.The macro may not be available in this workbook or all macros may be disabled.

And only If, I create module in report .xlsx file and paste VBA code, it runs smoothly.

I was trying to save report file as .xlsm, if there will be any change, but unfortunately same message:
Cannot run the macro 'BC.xlam!Macro'.The macro may not be available in this workbook or all macros may be disabled.
 
Upvote 0
What exactly are you doing to try to run the macro? Clicking a button somewhere?
 
Upvote 0
Thank you Rory for your time. It was actually caused by macro name. The code was looking for the macro titled "macro', so that's why it didn't work.
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

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