Force Acceptance of Macros

  • Thread starter Thread starter mot60
  • Start date Start date
M

mot60

Is there a way to allow macros automatically when opening a workbook using
code in the WorkBook_Open section?
 
No, otherwise what would be the point of allowing the user to set the
security level?
 
How do you ensure that the user allows macros when a workbook is opened? If
macros aren't allowed, then functionality is lost.
 
Two common suggestions are:

Save your workbook with one worksheet visible. It should have "Can't use
without macros" emblazoned across the screen.

Then have an auto_open macro (or workbook_open event) hide this sheet and unhide
the real ones.

If the user doesn't allow macros, they don't see the other sheets. If they do
allow macros, your code will hide the warning sheet and show the real ones.

The second suggestion is to use a dummy workbook that only has one purpose--to
open up the real workbook.

If the dummy workbook is opened with macros disabled, then it can't open the
real one.

If macros are enabled, it can open the real one (with macros enabled) and then
just close itself to get out of the way.
 
Thanks for the info. I have used the sheets idea.
Dave Peterson said:
Two common suggestions are:

Save your workbook with one worksheet visible. It should have "Can't use
without macros" emblazoned across the screen.

Then have an auto_open macro (or workbook_open event) hide this sheet and unhide
the real ones.

If the user doesn't allow macros, they don't see the other sheets. If they do
allow macros, your code will hide the warning sheet and show the real ones.

The second suggestion is to use a dummy workbook that only has one purpose--to
open up the real workbook.

If the dummy workbook is opened with macros disabled, then it can't open the
real one.

If macros are enabled, it can open the real one (with macros enabled) and then
just close itself to get out of the way.
 
Back
Top