Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi:
I am using a macro that involves unprotecting and protecting the sheet at the beginning and end of the macro. I have used this same code in a different spreadsheet's macro and it worked fine (including the allow filter part). However, when I run it on this spreadsheet, it re-protects it at the end, but WITHOUT the password. the code I am using is as follows: Sub Macro1() ActiveSheet.Unprotect Password:="Stars" (All Macro details go here...) ActiveSheet.Protect Password:="Stars" ActiveSheet.Protect AllowFiltering:=True End Sub Do you have any idea why it protects it but without the necessary password? thank you! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The second Activesheet.Protect has no password so wipes out the first
Activesheet.Protect Use this construct With ActiveSheet .Protect Password:="Stars" .EnableAutoFilter = True End With Gord Dibben MS Excel MVP On Fri, 18 Jul 2008 15:39:00 -0700, Roady wrote: Hi: I am using a macro that involves unprotecting and protecting the sheet at the beginning and end of the macro. I have used this same code in a different spreadsheet's macro and it worked fine (including the allow filter part). However, when I run it on this spreadsheet, it re-protects it at the end, but WITHOUT the password. the code I am using is as follows: Sub Macro1() ActiveSheet.Unprotect Password:="Stars" (All Macro details go here...) ActiveSheet.Protect Password:="Stars" ActiveSheet.Protect AllowFiltering:=True End Sub Do you have any idea why it protects it but without the necessary password? thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Password Protecting a worksheet | Excel Discussion (Misc queries) | |||
password protecting worksheet | Excel Discussion (Misc queries) | |||
Password Protecting One Cell | Excel Discussion (Misc queries) | |||
Password protecting a worksheet | Excel Worksheet Functions | |||
Password Protecting | Excel Discussion (Misc queries) |