Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using QV Variable in Macro

Hi ,

I am using below code to assign the Qv variable value to temp variable in macro code but it is not working.

Full_Pack_ind is a AV variable and by default it is 'N'.

Set A1  = ActiveDocument.Variables("Full_Pack_Ind")

MSGBOX "Value Output" & A1

  if A1 = "N" then

  MSGBOX "High Level Export Complete!",VbInformation

   end if

Can someone please help?

Regards,

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Define a variable vvv as follow: LET vvv=1; then use this:

SUB AAA
set v = ActiveDocument.GetVariable("vvv")
v.SetContent "999",true
msgbox("Value Output " & v.GetContent.String)
END SUB 

View solution in original post

4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

How to read and use a variable in macro:

...

set v = ActiveDocument.GetVariable("vRaw_WosF")
select case v.GetContent.String
case 1
v.SetContent "0",true

...

Not applicable
Author

Thanks for your reply however it is not working for me.

Regards,

alexandros17
Partner - Champion III
Partner - Champion III

Define a variable vvv as follow: LET vvv=1; then use this:

SUB AAA
set v = ActiveDocument.GetVariable("vvv")
v.SetContent "999",true
msgbox("Value Output " & v.GetContent.String)
END SUB 

Not applicable
Author

Hi @alexandros17

I have a Variable.

Example: vGraph = if(Graph='Line', CH01,

                                   If(Graph='Bar', 'CH02')

vGraph is a QV variable.

I am trying to export the chart to excel and trying to implement the value of selection of graph here.

So instead of GetSheetObject(qvObjectId). Can i use  ActiveDocument.GetVariable("vGraph ") in macro ??

Thanks in advance.