Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I would like to know if it's possible and if so how to:
store variables outside of QVW file and retrieve it back in the Macro?
My macro runs stored procedures and it needs to connect to a database. Since i have to switch between Test and Prod env often, can I store the vDBString, vDBUser, vDBPwd outside of the qvw's macro into say a text file, then when I run the macro have it read these values back from the text file?
thanks
Louise
Yes you can
see the attached, use this to export and import variables to a xls using macro
good luck
Fernando
Hi Fernando,
thanks for the confirm that it's possible to get variables from xls (or for that matter, text file). the confirmation reminded me as long as I can load the script that includes the text or excel file which defines my variables and values, then I can establish such variables in Qlikview, then in my macro i can just use the variables. Below is what I have created:
//TEST DB Connection String, this portion is saved in text file for the script to load in first
set vDBString = 'MyDBStringInfo';
set vDBUser = 'MeUser';
set vDBPassword = 'MePassword';
this portion is the macro:
vDBString = ActiveDocument.Variables("vDBString").GetContent.String
vDBUser = ActiveDocument.Variables("vDBUser").GetContent.String
vDBPwd = ActiveDocument.Variables("vDBPassword").GetContent.String
thanks
Louise