Protected sheet


Posted by Bob on April 06, 2001 10:42 AM

If I use Application.Dialogs(xlDialogProtectDocument).show, have a user set a password. Is their a way to do a

If Application.Dialogs(xlDialogProtectDocument)=True then
Msgbox "True"
else
Msgbox "False"
End If
????

In other words, if the sheet is protected via this method, I need to know if it is true or false.
Thanks in advance....Bj

Posted by bob on April 06, 2001 10:59 AM

I think I answered my own quetion by using

If Worksheets("DWL for 4-6-2001").ProtectContents = True Then
MsgBox "True"
Else
MsgBox "False"
End If

If anyone has a better solution, please let me know.

Thanks again! Bj



Posted by Dave Hawley on April 06, 2001 2:30 PM


Hi Bj

It really depends on what you want to do if the sheet is protected. Don't forget there is also: ProtectDrawingObjects
ProtectScenarios
as well.

Are you familiar with the UserIterFaceOnly argument in the Protect method via VBA ?


Dave

OzGrid Business Applications