Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle Button problem - Object doesn't support property or method? 1

Status
Not open for further replies.

DPlank

IS-IT--Management
Joined
May 30, 2003
Messages
1,903
Location
GB
Hi. I want to hide or unhide a few rows on a sheet based on the value of a togglebutton. It seemed obvious at first, simple even. But I'm getting error 438 Object does not support this property or method. Using Excel 97.

My code is
Code:
Private Sub ShowHide_Click()
Select Case ShowHide.Value

Case False
Rows("5:10").Select
Selection.EntireRow.Hidden = True
ShowHide.Caption = "Display Summary Info Only"

Case True
Rows("4:11").Select
Selection.EntireRow.Hidden = False
ToggleButton1.Caption = "Display Progress by Cycle and Day"
End Select

End Sub


Any ideas?

"Probably the only Test Analyst on Tek-Tips"

Take a look at Forum1393 & sign up if you'd like
 

It helps to be consistent. You apparently re-named the toggle button to "ShowHide" (or at least intended to).

You are referring to "ToggleButton1" in the True case and "ShowHide" in the False case.
 
Yeah, I caught that eventually.

But it turns out the problem was actually the combobox on the same page I'd helpfully named 'Selection'!!!!!!!


[cue major slapping of forehead]

Incidentally, any ideas how I can pull the file's last saved date ? I can't find info on in in Help

Thanks
Dave

"Probably the only Test Analyst on Tek-Tips"

Take a look at Forum1393 & sign up if you'd like
 
Hi Dave - have a look at the BuiltInDocumentProperties property of the Workbook - should be able to get what you need from there

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Thanks Geoff !

"Probably the only Test Analyst on Tek-Tips"

Take a look at Forum1393 & sign up if you'd like
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top