Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You will need to protect both the worksheet(s) and workbook structure like this: Code: -------------------- ActiveWorkbook.Protect Password:="PASSWORD", Structu=True, Windows:=False ActiveSheet.Protect Password:="PASSWORD", Contents:=True, Scenarios:=True -------------------- Substitute PASSWORD for whatever password you wish, just amend the code for UnProtect.JBeaucaire;167068 Wrote: 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. -- Simon Lloyd Regards, Simon Lloyd 'The Code Cage' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=46287 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How To Check If The User Has Macros Enabled When The Workbook Opens | Excel Programming | |||
choose default macros Not Enabled / Macros Enable Setting | Excel Programming | |||
Enabled macros | Excel Programming | |||
Open workbook-macros enabled, opening another with macros | Excel Programming | |||
How to have macros enabled at start | Excel Programming |