View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default VBA to Protect Worksheet

Try FALSE (all caps).

If that doesn't work, you could break the password...
(Visit JE McGimpsey's site: http://mcgimpsey.com/excel/removepwords.html)

Alex wrote:

I accidentally used the following code in some VBA to protect my worksheet:
ActiveSheet.Protect Password = "grencr" (I excluded the colon)

I should have used: ActiveSheet.Unprotect Password:="grencr".

The code worked and my worksheet is now protected, but I'm not sure what the
password is. It is no longer grencr. Any idea what my password was set to
since I didn't include the : in the code?

Thanks


--

Dave Peterson