Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a Variable called vCustomer
I have a macro that creates a new Qlikview file that I got from the community
SUB createfile
Set Qv = CreateObject("QlikTech.QlikView")
Set docObj = Qv.CreateDoc
docObj.SaveAs "C:\Users\alan\Desktop\$(vCustomer).qvw"
docObj.CloseDoc
Set docObj = Qv.OpenDocEx (qvwFullPath,0,false)
docObj.Save
docObj.CloseDoc
Qv.Quit
END SUB
I tried adding the Variable vCustomer to save the new Qlikview file as the Customer in my project, but it does not work.
Any suggestions
Regards
Alan
HI Refer this, Hope this will help you
I use ActiveDocument.Variables("varname").getcontent.string to get value from the qvw..maybe you can parse that into the saveas command ?
set v = ActiveDocument.GetVariable("vWos_Amount")
where vWos_Amount is my variable
Just as a side note to the already perfect replies from the others: macros do not have dollarsign-expansion applied to them. $(vVar) only works in QV script and in expressions, code for which the QlikView engine is responsible.
AFAIK macro's are handled by the standard Microsoft VBScript interpreter, that has no idea what $-sign substitution is actually. You'll have to pass through the QV object model to pick up variable values. Various methods to do this are provided in previous replies.
Good luck,
Peter