LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Can't get parameters on macros working...

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
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
2007/macros not working hughesdm Excel Worksheet Functions 1 April 23rd 09 03:28 PM
Macros not working when file run on a Mac Darby Excel Discussion (Misc queries) 4 November 5th 07 02:49 PM
Macros written in UK not working in US Teresa Excel Discussion (Misc queries) 1 April 19th 07 06:59 PM
Working with Macros - Help needed!!! The Greek Excel Discussion (Misc queries) 2 November 19th 06 05:39 PM
Advise, please, how to get the following macros working: LikBez Excel Programming 0 August 19th 03 08:53 AM


All times are GMT +1. The time now is 07:07 AM.

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"