Disabling Macros With VBA After Enabling

animas

Active Member
Joined
Sep 28, 2009
Messages
396
When user enables macros during workbook open, is there any vba or event that immediately disables macro for that workbook?

This way I need to ensure vba won't run for that workbook even if macro is enabled.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
If you mean when a user opens a workbook via the user interface, with no other workbooks open, then no way that I know of.

If the workbook is opened programmatically, then you can set Application.AutomationSecurity to msoAutomationSecurityForceDisable before opening the file.
 
Upvote 0
I created a global named range in a worksheet for disabling macros. What I need is when user will select it's value "YES" no macro should work. Any suggestion on these?
 
Upvote 0
You'd have to code all the macros to test that cell and abort if appropriate.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

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