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
 

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