View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JBeaucaire[_140_] JBeaucaire[_140_] is offline
external usenet poster
 
Posts: 1
Default Determining if the user enabled macros


Create a Workbook_BeforeSave and a Workbook_Close macro that protects
the sheet completely from any changes.

Then put in a Workbook_Open macro to unprotect the sheet automatically.

Since the protection is occuring in the background, only clicking on
ENABLE MACROS will present the user with a sheet that can be edited
since the Workbook_Open event won't run and unprotect it without macros
being enabled.

Also, once you've done this, be sure to password protect the code in
the VBE, too, so they can't read the code without a password, perhaps
the same one you're protecting and unprotecting with in the background.


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=46287