Enable/disable macros via vba

papaandy

New Member
Joined
Apr 21, 2011
Messages
2
How can i enable macros when the workbook opens and disable them them when workbook closes via vba? Your time and help is appreciated.
Thank you
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi and welcome

You can't enable/disable macros using VBA, what you can do is make your spreadsheet unusable if the user doesn't enable macros.
 
Upvote 0
Hello

Want to remove all macros in the spreadsheet?
This can be done better otherwise specify your request
 
Upvote 0
I am using excel 2007. I have this workbook with some worksheets in their containing some macros, like print buttons and other buttons that do specific tasks. Enabling all macros is pretty risky since malicious codes can run. We have to email this work book to our DM every Sunday and everytime he recieves it he has to enable all the macros, close the workbook and reopen it. I have assigned a digital certificate to this workbook but it works only on my computer and not others unless they enable all the macros. Any help is appreciated.
Thank you
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,843
Members
452,948
Latest member
UsmanAli786

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