Microsoft Excel 2000 allows you to add an additional layer of protection by
applying password protection to a previously protected sheet. You can add
this protection programmatically.
In some earlier versions of Microsoft Excel, using the
ActiveSheet.Protect command more than once has no effect. In Excel 2000, using the command a second time with a password applies password-level security to a previously protected sheet as long as the arguments for Contents, Scenarios, and DrawingObjects are not all set to
True. When all the arguments are set to
True, Excel protects the active sheet but does not apply password-level protection. The value of the
UserInterfaceOnly argument has no effect on this behavior.
The following sample code demonstrates the problem:
Sub Test()
ActiveSheet.Protect
ActiveSheet.Protect password:="pw", contents:=True, _
Scenarios:=True, DrawingObjects:=True, UserInterfaceOnly:=False
End Sub