Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
The correct form of getting a variable value is:
set var = ActiveDocument.Variables("vTestBatch")
val = var.GetContent.String
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"