ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Passing several parameters to OnAction property. (https://www.excelbanter.com/excel-discussion-misc-queries/228827-passing-several-parameters-onaction-property.html)

Labkhand

Passing several parameters to OnAction property.
 
Hi All,

I am trying to pass three parameters to the OnAction property of a menu
Control object. What is the syntax for passing these parameters as part of
the macro name?

I currently have:

With .Controls(Caption)
.OnAction = sMacroName
.Parameter = sParameter
.BeginGroup = bFlagDivider
.Enabled = sFlagEnabled
End with

I have tried the syntax " ' MACRO NAME ""p1string"", 2, ""p2string"" ' "
which is not working and i get a syntax error that the maco does not exist.

Please help.

ProfessionalExcel.com

Passing several parameters to OnAction property.
 
Going purely on the syntax you noted, try removing the spaces:

..onAction = "'MACRONAME ""p1string"", 2, ""p2string""'"

--
Please rate this post if it answers your question.

Thanks,

Chris
http://www.ProfessionalExcel.com




"LABKHAND" wrote:

Hi All,

I am trying to pass three parameters to the OnAction property of a menu
Control object. What is the syntax for passing these parameters as part of
the macro name?

I currently have:

With .Controls(Caption)
.OnAction = sMacroName
.Parameter = sParameter
.BeginGroup = bFlagDivider
.Enabled = sFlagEnabled
End with

I have tried the syntax " ' MACRO NAME ""p1string"", 2, ""p2string"" ' "
which is not working and i get a syntax error that the maco does not exist.

Please help.



All times are GMT +1. The time now is 02:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com