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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to refer to a value of a variable set in one macro in another macro?

How to refer to a value of a variable set in one macro in another macro?

1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

You can set the content of the QV variable in one macro and then get the content of the same QV variable in the other macro. Look in the API Guide for functions to handle variables.

Regards.

View solution in original post

3 Replies
pover
Partner - Master
Partner - Master

You can set the content of the QV variable in one macro and then get the content of the same QV variable in the other macro. Look in the API Guide for functions to handle variables.

Regards.

Miguel_Angel_Baeyens

Hi,

If the variable is document-wise (defined in either the script or the variable overview panel in the Settings menu, the following should work

Sub ReadVariable '' reads one variable Set v = ActiveDocument.Variables("vName") MsgBox(v.GetContent.String) '' this displays a message with the contents of vName variableEnd Sub Sub WriteVariable '' stores something into the variable Set v = ActiveDocument.Variables("vName") v.SetContent "New Value", true '' this stores "New Value" into variable vNameEnd Sub


Hope that helps.

Not applicable
Author

Thx