Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Consider a checkbox created at run-time something like this:
Dim CheckBox As Shape Set CheckBox=Me.Shapes.AddFormControl(xlCheckBox, 0,0,100,0) CheckBox.OnAction="'ClickHandler'" Sub ClickHandler() Debug.Print "Clicked!" End Sub Run the code and click on the checkbox and the ClickHandler runs. However, I'd love to be able to pass a parameter and I've read several posts whereby it says you can set OnAction to 'ClickHandler "Hello"' and it will pass "Hello" as the paramater: Dim CheckBox As Shape Set CheckBox=Me.Shapes.AddFormControl(xlCheckBox, 0,0,100,0) CheckBox.OnAction="'ClickHandler ""Hello""'" Sub ClickHandler(Text) Debug.Print "Clicked!" End Sub This just doesn't work - the code runs without complaining but ClickHandler never gets called when you click. What am I doing wrong? Thanks, Rob. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007/macros not working | Excel Worksheet Functions | |||
Macros not working when file run on a Mac | Excel Discussion (Misc queries) | |||
Macros written in UK not working in US | Excel Discussion (Misc queries) | |||
Working with Macros - Help needed!!! | Excel Discussion (Misc queries) | |||
Advise, please, how to get the following macros working: | Excel Programming |