T
TSW632
Hello Excel Wizards,
In Excel 2003, I have been using the code below (in the "This
Workbook" module of the file) in a shared file so users could group
and ungroup with protection on.
Now I need to change the protection password, and I can't figure out
how to make it work with a different password. I replace the password
in the code, and then I assign the new password for worksheet
protection, save and close the file, re-boot my PC, and still get a
"Run-time error '1004': The password you supplied is not correct..."
msg when I re-open the file.
Any ideas would be greatly appreciated.
Troy
'To allow group/ungroup on protected sheet
Sub workbook_open()
Dim SH As Worksheet
For Each SH In ThisWorkbook.Worksheets
With SH
..EnableOutlining = True
..Protect Password:="ooohahhh", _
Contents:=True, _
userinterfaceonly:=True
End With
In Excel 2003, I have been using the code below (in the "This
Workbook" module of the file) in a shared file so users could group
and ungroup with protection on.
Now I need to change the protection password, and I can't figure out
how to make it work with a different password. I replace the password
in the code, and then I assign the new password for worksheet
protection, save and close the file, re-boot my PC, and still get a
"Run-time error '1004': The password you supplied is not correct..."
msg when I re-open the file.
Any ideas would be greatly appreciated.
Troy
'To allow group/ungroup on protected sheet
Sub workbook_open()
Dim SH As Worksheet
For Each SH In ThisWorkbook.Worksheets
With SH
..EnableOutlining = True
..Protect Password:="ooohahhh", _
Contents:=True, _
userinterfaceonly:=True
End With