Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Passing parameters to Macro's when called by button

On edit Module (Javascript)

function alertJS1() {

var x=new ActiveXObject("WScript.Shell");

x.popup('works');

}


function alertJS(s) {

var x=new ActiveXObject("WScript.Shell");

x.popup(y);

}


On Button - in External - Macro - alertJS1   is okay

On Button - in External - Macro - alertJS('any message')   not okay


















1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The Action -> Run Macro does not pass parameters. Possible workarounds are:

1. Set a variable value before calling the macro. And then read the variable value in the macro.

2. Use Multiple (differently named) Subs that call the main sub, passing a parameter.

-Rob

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The Action -> Run Macro does not pass parameters. Possible workarounds are:

1. Set a variable value before calling the macro. And then read the variable value in the macro.

2. Use Multiple (differently named) Subs that call the main sub, passing a parameter.

-Rob

Anonymous
Not applicable
Author

correct.

Tkx

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can mark an answer as correct which will close the thread.

Rob