mabehr
asked on
"Cannot run the macro ...The macro may not be available in the workbook or all marcros may be disabled."
I get this message when I click on a button to run a macro:
"Cannot run the macro ...The macro may not be available in the workbook or all marcros may be disabled."
I do have my macro settings in the Trust Center as "Enable all macros..." and the "Trust access to the VBA project..." enabled
but when I click on the button that is what I get.
And I do have the file saved as a .xlsm and .xls and neither way works. Any ideas?
"Cannot run the macro ...The macro may not be available in the workbook or all marcros may be disabled."
I do have my macro settings in the Trust Center as "Enable all macros..." and the "Trust access to the VBA project..." enabled
but when I click on the button that is what I get.
And I do have the file saved as a .xlsm and .xls and neither way works. Any ideas?
It is very likely that the macro has been renamed.
Right-click on the button object (if a Form control object) then select "Assign Macro..." and ensure that it is referring to the correct macro. The alternate solution is to rename your macro back to the name the button was referring to.
Regards,
-Glenn
Right-click on the button object (if a Form control object) then select "Assign Macro..." and ensure that it is referring to the correct macro. The alternate solution is to rename your macro back to the name the button was referring to.
Regards,
-Glenn
ASKER
Thanks Glenn. It is pointing to the right macro (there's only one) but maybe my button is not really a button. I just drew a rectangular object and assigned the macro to it. Should that work?
ASKER
@MartinLiss, I'll post a screen shot of what everything looks like tomorrow when I get to work. Thanks.
Yes your shape should work but I bet your macro didn't show up in the list.
Martin is correct; a drawing object should work. However, check carefully the name of the macro seen using the "Assign Macro..." steps I listed above with the name (and possibly path) of the macro in your workbook.
ASKER
Attached are screenshots showing my setttings and code but still getting the error.
Screen-Shot-07-15-14-at-08.19-AM.PNG
Screen-Shot-07-15-14-at-08.20-AM.PNG
Screen-Shot-07-15-14-at-08.20-AM-001.PNG
Screen-Shot-07-15-14-at-08.19-AM.PNG
Screen-Shot-07-15-14-at-08.20-AM.PNG
Screen-Shot-07-15-14-at-08.20-AM-001.PNG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ahhh!!! Screenshots always help in discovering the problem. In this case user error. Thanks Glenn Ray. That worked and it now does what it's supposed to do. Thank you VERY much!
Private Sub MyMacro
or
Public Sub MyMacro
If so change it to
Sub MyMacro
and move it to a code module (like module1) if it's not already there. You may have to insert a module if you don't have module1.