Macro may be disabled...

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,332
Office Version
  1. 365
Platform
  1. Windows
I created a shape on a tab and assigned a Macro to it (Actual several on different tabs). When I click the "Button" I get a message that reads:

Cannot run macro "PPT4 SQID Quotes Tool". The Macro may not be available in this workbook or all macros may be disabled.

I only have one workbook open and I just created the code in VBA. So I don't think its that its not available. This is not a new workbook, it had numerous macros assigned to "button" that worked the last time the workbook was opened. Now I get this message for everything I try to run. If I go directly into VBA and run the code from there it works.

Any ideas what happened?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
That can't be the actual macro name since you can't have spaces in there. It sounds like the macro isn't correctly assigned.
 
Upvote 0
That's the Workbook name. I did out write out the entire message. But you sent me in the right direction. Looks like my workbook table is too long because when I assign a macro its not including the entire macro name. I will try and shorten the workbook name
 
Upvote 0
If I may "borrow" your question, I had the same happening to me: my file crashed and all buttons&checkboxes that were linked to macros seem detached with that message "The macro may not be available in this workbook or all macros may be disabled". I asked this on Reddit ( ), but zero practical answers:

I'm working on a big excel file with quite some macros, a custom menu etc. What happened recently is that somewhere during development, the file crashed, so excel restarted etc. My file was still intact, the macros were still there, but all buttons on my start sheet were "disconnected" from the macros they were attached to. The same macros start fine from the menu bar (custom UI bar).

So with my file in this "disconnected" state: I'm using the "Form Buttons" (not the ActiveX elements) and would select "assign macro" and select one. But when I after that press the button it fails - message: The macro may not be available in this workbook or all macros may be disabled. This happens for both the existing buttons/checkboxes and the ones I add new to the file. When I run the macro manually, it works like a charm.

Now the kicker: I just managed by some fiddling (compiling the project, editing the custom menu XML and saving the file a couple of times) to get the buttons/checkboxes to work again for a little while, only to fail now after the file has crashed in development again...

Does anyone know a consistent method to solve this "macro detaching"?

P.S. It has nothing to do with excel settings, it's the same settings every time, sometimes working, sometimes disconnected.

I now found this solution on StackOverflow: Running Excel macro using button not working :
Solved - turned out I needed to check the box for "Enable Excel 4.0 Macros". Apparently, Microsoft has just started disabling this by default in Office 365 starting this month!
So in Excel... File>>Options>>Trust Center>>Trust Center Settings>>Macro settings

I'm going to try that, it seems to work for now, hope it might work for you.
 
Upvote 0
Solution

Forum statistics

Threads
1,213,494
Messages
6,113,974
Members
448,537
Latest member
Et_Cetera

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