Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with passing variable from bat file to macro in qlikview

Hi there,

I'm having a problem with passing a variable from a bat file to a macro in qlikview. It functioned before but somehow it refuses to take the variable from the command line. My bat file looks like this:

"C:\Program Files\QlikView\Qv.exe" /vTestBatch=1 "C:\QlikViewData\Develop\Test Bat file.qvw"

My macro like this:

sub TestBat
if vTestBatch = 1 then
msgbox("succes")
else
msgbox("fail")
end if

End Sub

I put a trigger on opening. I keep getting the msgbox with the message fail. Can anybody help me on this one. How does the passing of the variable exactly work? Does the variable have to be present in the document and does the bat file set it or does the bat file create it even if it doesn't exists?

In general I would like some more info on the use of bat file and command line specifications. Is there a place where I can find this?

Thanks in advance!

2 Replies
Clever_Anjos
Employee
Employee

The correct form of getting a variable value is:

set var = ActiveDocument.Variables("vTestBatch")

val = var.GetContent.String

Gysbert_Wassenaar

The variable should already exist. You test for vTestBatch, but you pass a variable TestBatch. If you add another v after /v it ought to work: "C:\Program Files\QlikView\Qv.exe" /vvTestBatch=1 "C:\QlikViewData\Develop\Test Bat file.qvw"


talk is cheap, supply exceeds demand