Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting Sheets, automatically protects the workbook
I am trying to protect particular sheets in a workbook.
Code used: Private Sub Workbook_Open() Password = "1234" Sheets("MasterData").Protect Password, True, True, True Sheets("Unassigned Requests").Protect Password, True, True, True End sub And i unprotect using Sheets("Unassigned Requests").Unprotect Password This protects my entire workbook when i open it the next time. How to avoid this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting Sheets, automatically protects the workbook
First, you have another active thread.
Second, the code you included here doesn't protect the workbook--it protects those worksheets. Excel has various levels of protection. Worksheet protection (tools|protection|protect sheet) -- to keep users from changing locked cells and changing formatting. workbook protection (tools|protection|protect workbook) -- to keep users from inserting/deleting worksheets (structure) or to keep the users from changing the window sizes (Windows) VBA Project protection -- to keep your code from prying eyes. And workbook protection (again). This can be used to prevent users from even opening the workbook--or only allow the user to open in readonly mode. Your code does that worksheet protection stuff. Thiaga wrote: I am trying to protect particular sheets in a workbook. Code used: Private Sub Workbook_Open() Password = "1234" Sheets("MasterData").Protect Password, True, True, True Sheets("Unassigned Requests").Protect Password, True, True, True End sub And i unprotect using Sheets("Unassigned Requests").Unprotect Password This protects my entire workbook when i open it the next time. How to avoid this? -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting Sheets, automatically protects the workbook
Private Sub Workbook_Open()
Sheets("masterdata").protect Password = "1234" Sheets("Unassigned Requests").Protect Password="1234" End sub And i unprotect Sheets("Unassigned Requests").Unprotect Password ="1234" "Thiaga" wrote: I am trying to protect particular sheets in a workbook. Code used: Private Sub Workbook_Open() Password = "1234" Sheets("MasterData").Protect Password, True, True, True Sheets("Unassigned Requests").Protect Password, True, True, True End sub And i unprotect using Sheets("Unassigned Requests").Unprotect Password This protects my entire workbook when i open it the next time. How to avoid this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protecting workbook sheets | Excel Discussion (Misc queries) | |||
Protecting sheets within a workbook | Excel Discussion (Misc queries) | |||
Code to protect sheets, protects work book also? | Excel Programming | |||
Protecting a book protects too much?! | Excel Programming | |||
Protecting all sheets in a workbook | Excel Programming |