Macro to Always Enable Macros

Tennisball

New Member
Joined
Aug 2, 2010
Messages
5
Is there a Macro that ensures that macros are always enabled, everytime the workbook is opened? I am looking for something that I can apply to my workbooks that ensures that the macros I have written for my passwords are always enabled.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
No.

The fundamental idea of macro security is that a macro cannot run unless you allow it.

There are some ways to "force" people to turn on macros, basically making the workbook useless unless macros are enabled.
 
Upvote 0
Ok thanks that is really good to know. So how do I write a macro that makes the work book useless unless macros are enabled. Like is there a way to write a macro that makes certain sheets appear from veryhidden only when the macro is enabled?
 
Upvote 0
well if the macros are enabled - put the code to unhide the
and for the workbook - Beforeclose event - hide them again and save
so when opened next with disabled macros the sheets stay hidden.
of course if not properly closed - they will stay visible

Hope this will work :)
 
Upvote 0
Ok thanks that is really good to know. So how do I write a macro that makes the work book useless unless macros are enabled. Like is there a way to write a macro that makes certain sheets appear from veryhidden only when the macro is enabled?
Essentially how it's done, IIRC, is that you have all sheets "veryhidden" except a empty "info" sheet which would contain a note that macros are required for the workbook.

In the Workbook.open you place code that unhides all the sheets and hides the info sheet. In Workbook_BeforeClose you place code that unhides the info sheet and hides all the other sheets.

This is by no means fully secured, as Excel can be broken open relatively easily. And there is bound to be problems e.g. if the workbook crashes and is restored it is probably in an "open" state. So if we are talkign stuff that really really need to be confidential then Excel isn't quite the place.
 
Upvote 0

Forum statistics

Threads
1,215,720
Messages
6,126,436
Members
449,314
Latest member
MrSabo83

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