Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
sheet protection
Hi and thanks in advance,
I have this problem of unprotecting a sheet, allowing for certain features and want to protect that with a password again. When I do that, I am getting syntax error. Someone please help, code: Sub Macro4() ActiveSheet.Unprotect Password:="hiacsc" ActiveSheet.Protect Password:="hiacsc" DrawingObjects:=True, _ Contents:=True, Scenarios:=True , AllowFormattingCells:=True, _ AllowFormatingColumns:=True, _ AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True ActiveSheet.EnableSelection = xlNoRestrictions End Sub If I omit Password for protecting the sheet it does what I want, but when I protect that with Password atrribute, it is giving me syntax error. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
sheet protection
Hi Nasir,
Try changing: ActiveSheet.Protect Password:="hiacsc" DrawingObjects:=True, _ to ActiveSheet.Protect Password:="hiacsc", DrawingObjects:=True, _ Note the comma after "hiacsc" --- Regards, Norman wrote in message ups.com... Hi and thanks in advance, I have this problem of unprotecting a sheet, allowing for certain features and want to protect that with a password again. When I do that, I am getting syntax error. Someone please help, code: Sub Macro4() ActiveSheet.Unprotect Password:="hiacsc" ActiveSheet.Protect Password:="hiacsc" DrawingObjects:=True, _ Contents:=True, Scenarios:=True , AllowFormattingCells:=True, _ AllowFormatingColumns:=True, _ AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True ActiveSheet.EnableSelection = xlNoRestrictions End Sub If I omit Password for protecting the sheet it does what I want, but when I protect that with Password atrribute, it is giving me syntax error. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
sheet protection
You forgot a comma right between "hiacsc" and DrawingObjects
HTH -- AP a écrit dans le message de news: ... Hi and thanks in advance, I have this problem of unprotecting a sheet, allowing for certain features and want to protect that with a password again. When I do that, I am getting syntax error. Someone please help, code: Sub Macro4() ActiveSheet.Unprotect Password:="hiacsc" ActiveSheet.Protect Password:="hiacsc" DrawingObjects:=True, _ Contents:=True, Scenarios:=True , AllowFormattingCells:=True, _ AllowFormatingColumns:=True, _ AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True ActiveSheet.EnableSelection = xlNoRestrictions End Sub If I omit Password for protecting the sheet it does what I want, but when I protect that with Password atrribute, it is giving me syntax error. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Data Protection Best Practice: AKA: Real Sheet Protection | Excel Discussion (Misc queries) | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
sheet Protection | Excel Discussion (Misc queries) | |||
Sheet protection on MAC | Excel Discussion (Misc queries) | |||
Sheet protection error msg - Unrequested sheet activation | Excel Programming |