How do you find out if an excel file is currently locked with a password? I don't want to know the password, just if it is protected or not (boolean).
Printable View
How do you find out if an excel file is currently locked with a password? I don't want to know the password, just if it is protected or not (boolean).
VB Code:
If ActiveWorkbook.HasPassword = True Then Msgbox "Contains a password" Else Msgbox "Does not have a password" End If
Doh!
So simple.
Umm I knew it really but I was just testing you, honest. :D