View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] idyllicabyss@googlemail.com is offline
external usenet poster
 
Posts: 32
Default Test if protected

Just run

ActiveWorkbook.Protect Contents:= true
or
ActiveWorkbook.Protect Contents:= true password:= "passkey"

then you know it is.

and

ActiveWorkbook.Unprotect
or
ActiveWorkbook.Unprotect Password:= "passkey"

when you need to unprotect it.

Do you really need to query the status?
You could try to change the value of a cell you know should be locked
and intercept the error if Protection is enabled.