View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andrew[_51_] Andrew[_51_] is offline
external usenet poster
 
Posts: 4
Default protect and unprotect

Jackpot!

2 sheets had different passwords

Many thanks

Andrew


"Andrew" wrote in message
...
Hi - I am either missing something really simple or something else is
happening:

This works fine...
sub proc i_protect
Dim mySheet As Worksheet

For Each mySheet In Worksheets
mySheet.protect ("abc1234")
Next mySheet

end sub

This says the password is incorrect...
sub proc i_unprotect
Dim mySheet As Worksheet

For Each mySheet In Worksheets
mySheet.Unprotect ("abc1234")
Next mySheet

end sub

Any ideas?

Thanks

Andrew