adding Password:="lockIT" does work.. note the syntax of a named
parameter..
Sub Macro1()
If ActiveSheet.ProtectContents Then
ActiveSheet.Unprotect Password:="lockIT"
Else
ActiveSheet.Protect Contents:=True, Password:="lockIT"
End If
MsgBox "Protection = " & IIf(ActiveSheet.ProtectContents, "ENabled",
"DISabled")
End Sub
keepITcool
< email : keepitcool chello nl (with @ and .)
< homepage:
http://members.chello.nl/keepitcool
John Baker wrote:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
adding Password="xxx" does not work, and somehow the help file doesn't
help either.