Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have the following code in Thisworkbook module: Private Sub Workbook_Open() UnprotectWorkbook UnHideSheets ProtectWorkbook End Sub Private Sub ProtectWorkbook() ThisWorkbook.Protect Structu=True, Windows:=False, password:="xxxx" 'MsgBox ("Protected") End Sub Private Sub UnprotectWorkbook() ThisWorkbook.Unprotect password:="xxxx" End Sub The Unhidesheets macros is from http://www.cpearson.com/excel/EnableMacros.aspx But despite the ProtectWorkbook line in the Workbook open event, the Workbook is unprotected on opening. Am I doing something wrong. I tried putting a message box in the Protecteworkbook (commented out above). The message box pops up, indicating that processing has reached that stage. But the workbook still remains unprotected on opening. Am I doing something wrong? Please help. Thanks in advance. Regards, Raj |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protecting a workbook | Excel Worksheet Functions | |||
protecting workbook | Excel Discussion (Misc queries) | |||
Problem protecting cells in a mult-page workbook | Excel Discussion (Misc queries) | |||
Protecting Workbook!.. | Excel Worksheet Functions | |||
Protecting Workbook | Excel Discussion (Misc queries) |