forcing 'macro enable' on open

  • Thread starter Thread starter i-Zapp
  • Start date Start date
I

i-Zapp

Is there a way to essential "force" a user to enable macros by eithe
giving him the choice to enable, or if he doesnt then the workbook i
forced to close?

In other words, a user cannot edit the workbook without allowing macro
enabled.

I know that if the wb contains XL4.0 macros and the security level i
set to high, then this exact scenario exists... but i cannot ensure th
user's Excel security level is set to High
 
No, you can't truly force a user to do anything. One possible way that will
work with less sophisticated users is to hide all but the sheets except one,
and on that sheet have a message "Hey, only open this workbook with the
macros enabled."

Then use the workbook open event to hide that 'message' sheet and unhide the
others. Password protect everything, including sheets, workbook, and VBA
project, so if they open the workbook with macros enabled, they get to see
the sheets, otherwise, they only get the message sheet.

HTH,
Bernie
MS Excel MVP
 
You can't force a user to enable macros, that would defeat the security
settings. And if macros are disabled, then you can't force the wb to close.
What you can do is create a sheet with a statement on it something like "You
must enable macros to use this Workbook. Close the Workbook and re-open with
macros enabled." In the Private Sub WorkBook_Open() of ThisWorkbook, Hide
this sheet and Unhide all the other sheets. In the Private Sub
WorkBook_Close() of ThisWorkbook, Hide all the other sheets and unhide this
one. This will make only the warning sheet visible when the book is closed.
If it is opened with macros disabled, then the WorkBokk_Open cannot run and
all they can do is read the warning sheet.

Mike F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top