
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Button > Action > start vbs-script with parameter
I have a vbs-script which I want to start with a button in QlikView. This is working fine, but now I want to add some Parameter to the script.
In Windows-Shell I can start the script like this
script.vbs Para1 Para2
But how can I add the parameters to QlikView? It is possible to get the parameter in QV from a getfieldselection oder variable?
I tried Parameters but I get an errormessage.
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Consider using your vbscript in Edit Module as a macro, and your button action will be "Run Macro". A variable can be used as parameter in this case.
Regards,
Michael
.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had to do something similar a while back. Variables cannot be passed in the code from the button. But you can use a preceding action to assign a value to a variable, and then reference the values in variables from within your VB script. As an example, the code below gets the string value from a variable named vObjectID and then strips out the double quotes.
sTableID = ActiveDocument.GetVariable("vObjectID").GetContent.String | |
sTableID = replace(sTableID, """", "") |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I will try it this week and tell you how it works.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lee,
I see the reason of the confusion. I didn't mean "using parameter in the button". I meant use a variable as parameter in the macro. The value of the variable can be set manually in an input box.
If the value of the variable can be set automatically based on some conditions - it can be set in the macro itself instead of an additional action, meaning that parameter not needed at all.
Regards,
Michael
.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Michael
That’s a good point, there are many ways that the value of the variables could be set. The macro could also reference values from the current field selections.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did not thought of qlikview macro, this is a very good idea.
But I get another errormessage when I use the same script in QV (type VBScript, System Access, Allow System Access)
Set Para = wscript.Arguments
QV tells me 'Objekt erforderlich: 'wscript'' (means Object needed: 'wscript') But I think I need this for my parameters
dim Servername
Servername = Para(0)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you need to set Module Security to System Access, and Corrent Local Security to Allow System Access - they are in the bottom left part of the window.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks, but I did -
(type VBScript, System Access, Allow System Access)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, wasn't careful 😞
Are you using "option explicit"? If yes, make sure you have "dim wscript".
Also, maybe you don't need "set" here, just
Para = wscript.Arguments
(Just a wild guess, can't tell for sure without seeing the whole picture. And I'm not a VBScript expert.)
I often use msgbox-es in the macro script to debug, helps to see what is going on.
