Sheila Yau
New Member
- Joined
- Nov 29, 2006
- Messages
- 20
Hi All,
I have some code to protect a worksheet which works OK.
Sub protect()
strPwd1 = "test"
ActiveSheet.protect (strPwd1)
End Sub
I then adapted this to allow edit objects on a protected worksheet
Sub protect1()
strPwd1 = "test"
ActiveSheet.protect (strPwd1)
ActiveSheet.protect DrawingObjects:=False
End Sub
When I run this a message box "Unprotect Sheet" appears.I can just cancel on this message box but is there a way of adapting the code so the message box doesn't appear?
Thank you for any help
Sheila
I have some code to protect a worksheet which works OK.
Sub protect()
strPwd1 = "test"
ActiveSheet.protect (strPwd1)
End Sub
I then adapted this to allow edit objects on a protected worksheet
Sub protect1()
strPwd1 = "test"
ActiveSheet.protect (strPwd1)
ActiveSheet.protect DrawingObjects:=False
End Sub
When I run this a message box "Unprotect Sheet" appears.I can just cancel on this message box but is there a way of adapting the code so the message box doesn't appear?
Thank you for any help
Sheila