S
SDUNFORD
I am trying to allow users of my workbook to run macros on protected
worksheets. I have tried using the following code:
Private Sub Workbook_Open()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
wSheet.Protect Password:="Secret", _
UserInterFaceOnly:=True
Next wSheet
End Sub
When I then open the workbook, it says that the password I provided is
incorrect. I changed the "Secret" password to the correct one and that
didn't work. I also tried using "Secret" as the password to protect the
worksheets and that still didn't work. Does anyone have any suggestions or a
different way to do this?
worksheets. I have tried using the following code:
Private Sub Workbook_Open()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
wSheet.Protect Password:="Secret", _
UserInterFaceOnly:=True
Next wSheet
End Sub
When I then open the workbook, it says that the password I provided is
incorrect. I changed the "Secret" password to the correct one and that
didn't work. I also tried using "Secret" as the password to protect the
worksheets and that still didn't work. Does anyone have any suggestions or a
different way to do this?