Keith
Something like this perhaps:
Sub testme02()
Dim wks As Worksheet
Set wks = ActiveSheet
With wks
If .ProtectContents _
Or .ProtectDrawingObjects _
Or .ProtectScenarios Then
MsgBox "oh, oh. Somekind of protection"
End If
End With
End Sub
Can this be done before I attempt to open the spreadsheet?
I need to process a large number of XLS files. I want to note pwd
protected files as exceptions. I am using Automation, not VBA as you
have indicated below.
Otto's code checks for worksheet protection. It kind of sounds like you want to
check for the file|open type of protection.
I'm not sure how you're automating this (VB??), but if I were doing it in
excel's VBA, I could do try to open it with a password of "" and if it failed,
it had a real password:
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.