Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

possibility check protected sheet for password

Status
Not open for further replies.

sbdproj

Programmer
Sep 22, 2003
22
NL
Hi,

I want to make a sheet unptotected so I use the function ActiveSheet.Unprotect. This works nice but sometime the sheets is protected and I have to use the password to unprotect the sheet.
I want to know if the sheets is protected with a password or not so I can call the unprotect function with password or without.

So my question is: is there a way to check the sheet if it's protected with a password or protected without a password?


thanx
 
but how are you going to choose the password if that is the case

You could use this type of construct but it'd only work for one password:
Code:
on error resume next
Activesheet.unprotect
if activesheet.protectcontents = true then
  activesheet.unprotect (password)
end if

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top