How to prevent Excel alert "Cannot run the macro. The macro may not be available in this workbook or all macros may be disabled."

I am trying to use a "Scroll Bar" as a slider to continuously change a cell value in Excel.


When I attempt to use the slider, I get the following alert: "Cannot run the macro. The macro may not be available in this workbook or all macros may be disabled."


I already have gone into Preferences -> Security and selected Enable All Macros. I have also restarted Excel, restarted my computer, and reopened the document. But I still get this annoying alert even though macros are enabled.


How do I make this alert go away so I can use the scroll bar?

MacBook Pro 15″, macOS 11.6

Posted on Apr 17, 2023 11:55 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 17, 2023 12:07 PM

I found the following solution while waiting for Apple Care.


Go to Macros under the Developer tab.


Enter the name of the macro associated with a scroll bar -- for example "ScrollBar1_Change".


This will open up the Visual Basic Editor with a copy of the macro that appears to be an empty subroutine -- for example:


Sub ScrollBar1_Change()


End Sub


Now just close the VBA editor.


You are done! The slider should now function perfectly without the annoying error message.


I am not sure why these steps are necessary.


It appears that the only function of these steps is to add the macro to the list of macros associated with the workbook. Once the macros are on the list, they work fine without the popup alerts appearing.




1 reply
Question marked as Top-ranking reply

Apr 17, 2023 12:07 PM in response to Stephen Salser

I found the following solution while waiting for Apple Care.


Go to Macros under the Developer tab.


Enter the name of the macro associated with a scroll bar -- for example "ScrollBar1_Change".


This will open up the Visual Basic Editor with a copy of the macro that appears to be an empty subroutine -- for example:


Sub ScrollBar1_Change()


End Sub


Now just close the VBA editor.


You are done! The slider should now function perfectly without the annoying error message.


I am not sure why these steps are necessary.


It appears that the only function of these steps is to add the macro to the list of macros associated with the workbook. Once the macros are on the list, they work fine without the popup alerts appearing.




This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to prevent Excel alert "Cannot run the macro. The macro may not be available in this workbook or all macros may be disabled."

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.