Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default unprotect sheet in code and make sheet visible

Are you running xl97?

Is your code associated with a checkbox from the controltoolbox toolbar?
If yes, then try adding:
activecell.activate
to the top of your code.

If it's run from a control from the control toolbox toolbar that has a
takefocusonclick property, you can change that to False.

(It's a bug that was fixed in xl2k.)

If none of this was true, then post back with your version of excel, where the
code is located, and how it's called.





peach255 wrote:

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!


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re-post: Code to make sheet very hidden based on date wx4usa Excel Discussion (Misc queries) 1 December 30th 08 06:19 AM
Code to protect/unprotect a sheet using a macro with password FredH Excel Discussion (Misc queries) 5 October 23rd 07 04:49 PM
how to Unprotect sheet mangesh Excel Discussion (Misc queries) 1 July 24th 06 10:34 PM
Excel worksheet - Can I make changes in one sheet affect contents of other sheet? [email protected] Excel Discussion (Misc queries) 3 July 11th 06 03:34 PM
is there anyway to make it so the users of my excel spread sheet cant view the macro code w/o a password? Daniel Excel Worksheet Functions 2 June 28th 05 05:34 AM


All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"