Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using the code below to switch between a development enviroment, where I
can view private data and change anything I want to on a sheet, and a user environment where private data is hidden and the user interface is protected. It works, EXCEPT for whatever happens to be the active sheet when I invoke the macro. Thanks In Advance! Eric Public Sub ProtectAllSheets(protectionLevel As ProtectionOptions) On Error GoTo ProtectAllSheets_Error Dim wks As Worksheet For Each wks In ActiveWorkbook.Sheets Select Case protectionLevel Case Protect Call wks.Protect(UserInterfaceOnly:=False, Password:=pWord) Case Unprotect Call wks.Unprotect(pWord) End Select Next wks On Error GoTo 0 Exit Sub ProtectAllSheets_Error: MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure ProtectAllSheets of Module MSecurity" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
vlookup failure & ctrl-f failure? | Excel Discussion (Misc queries) | |||
Ctrl+Home failure when sheet protected | Excel Discussion (Misc queries) | |||
Copying objects to new sheet failure | Excel Discussion (Misc queries) | |||
Chart versus Work Sheet Code Failure | Excel Programming | |||
unprotect sheet in code and make sheet visible | Excel Programming |