Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm having a TypeName problem and need some ideas.
To see my problem, put two option buttons from Control Toolbox (not Forms) on your worksheet. Then, in the Sheet1 module, set up this code: Private Sub OptionButton1_Click() Foo OptionButton1 End Sub Private Sub OptionButton2_Click() Foo OptionButton2 End Sub Sub Foo(Button As OptionButton) Debug.Print "Success!" End Sub When I click on an option button I get a Run Time Error 13, Type mismatch. This is strange, because when I use the Immediate pane to enter... Print TypeName(OptionButton1) ....I'm told that OptionButton12 is, indeed, an OptionButton. Obviously, in Foo, I could define Button as a variant. But that just ignores the problem. Why am I getting an error when I define an option button as an option button? Thanks. Charley |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
optionbutton - three options | Excel Discussion (Misc queries) | |||
Optionbutton troubles | Excel Worksheet Functions | |||
OptionButton. Reset to 0 | New Users to Excel | |||
How Do I Tab From An OptionButton To A TextBox | Excel Discussion (Misc queries) | |||
Use Arrow keys in optionbutton | Excel Programming |