Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi - I have two option buttons (controls) on a sheet - no frame round
them. In a certain scenario I want the 2nd optionbutton to be disabled so the user can not click in it. This is my code: Sub test2() Sheets("Detail").Shapes("OptionButton2").Select If Selection.Enabled = True Then Selection.Enabled = False Else Selection.Enabled = True End If End Sub When the design icon in the control toolbox is enabled the code works fine. Otherwise, when in normal non design mode I get "Object doesn't support this property or method". (Reason I have no frame is that the 2 optionbuttons dissapear behind it) Any ideas? Thanks Andrew |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub test2()
With Sheets("Detail").OleObjects("OptionButton2").Objec t If .Enabled = True Then .Enabled = False Else .Enabled = True End If End with End Sub -- Regards, Tom Ogilvy "Andreww" wrote: Hi - I have two option buttons (controls) on a sheet - no frame round them. In a certain scenario I want the 2nd optionbutton to be disabled so the user can not click in it. This is my code: Sub test2() Sheets("Detail").Shapes("OptionButton2").Select If Selection.Enabled = True Then Selection.Enabled = False Else Selection.Enabled = True End If End Sub When the design icon in the control toolbox is enabled the code works fine. Otherwise, when in normal non design mode I get "Object doesn't support this property or method". (Reason I have no frame is that the 2 optionbuttons dissapear behind it) Any ideas? Thanks Andrew |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom.
Works a treat, tried all sorts of things but have never come across the OleObjects thing before. Regards Andrew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheets and Control Option Buttons | Excel Worksheet Functions | |||
How do I create a form in a worksheet with control option buttons. | New Users to Excel | |||
No control for option buttons, invisible macro?? | Excel Programming | |||
Selective control of Option Buttons | Excel Programming | |||
Control Box Option Buttons | Excel Programming |