How do I keep a file from opening unless macros are enabled?

  • Thread starter Thread starter sharken
  • Start date Start date
S

sharken

I have a file I send to customers that needs a macro to run in order for the
data to be correct. Is there a way to force a user to click on enable macros
in order for the file to open?
 
There is no foolproof way, but a common approach is to have a dummy
sheet with a warning that macros must be enabled, and a WorkbookOpen
event macro which will hide that sheet and reveal all the other
sheets. A WorkbookClose event macro will hide all the other sheets and
unhide the dummy sheet.

So, if the file is opened without macros, then only the dummy sheet
with the warning is visible, and the user can't do much with the file.

The technique is described on Chip Pearson's site in more detail here:

http://www.cpearson.com/excel/EnableMacros.aspx

Chip also has other ways of trying to ensure that macros are enabled.

Hope this helps.

Pete
 
Back
Top