I have a button on a form that clicking it brings up a menubar with several controls.
Then selecting each control, will execute a function.
Here's a simplified version of what I have :
The above works perfect.
The advice I need:
How can I pass one or more parameters to these functions?
I tried
itm.OnAction = "Function1(100,200,300)"
but after adding the parameters, nothing happens. Function1 is not executed.
thank you.
Then selecting each control, will execute a function.
Here's a simplified version of what I have :
Code:
Dim Mnu As CommandBar
Dim itm As CommandBarControl
Set Mnu = CommandBars.Add("", msoBarPopup, , True)
Set itm = Mnu.Controls.Add: itm.Caption = "Control1": itm.OnAction = "Function1"
Set itm = Mnu.Controls.Add: itm.Caption = "Control2": itm.OnAction = "Function2"
Mnu.ShowPopup
The above works perfect.
The advice I need:
How can I pass one or more parameters to these functions?
I tried
itm.OnAction = "Function1(100,200,300)"
but after adding the parameters, nothing happens. Function1 is not executed.
thank you.