View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
peach255 peach255 is offline
external usenet poster
 
Posts: 2
Default unprotect sheet in code and make sheet visible

I have a worksheet that is hidden. Whenever the checkmark
is clicked, which would result in F12="TRUE", then I want
it to open this other sheet called "Polymerase". However,
the sheet is protected w/ a password, and I do not want it
to prompt the user w/ the password.
I have the following code so far:

If Worksheets("Instructions").Range("F12") = True Then
Sheets("Polymerase").unprotect password:="INGRAM"
Sheets("Polymerase").Visible = True
Sheets("Polymerase").Select
Else
Sheets("Polymerase").Visible = False
End If

And I get a " Run-time error '1004' Unable to set the
Visible property of the Worksheet class. "

Thank you!