Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Use macro to bring a specific variable from another qvw

Hi,

I'm trying to set a variable with the active sheet of a qvw using a macro:

sub ActiveSheet

  set v = ActiveDocument.Variables("vTest")

  set s = ActiveDocument.ActiveSheet

  v.SetContent s.GetProperties.SheetId,true

end sub

Now I want to read this vTest at the opening of another qvw and save it with the same name vTest.

How can I do this???

2 Replies
Gysbert_Wassenaar

Maybe something like this:

Sub SetvTest


    set QVar = ActiveDocument.Variables("vTest")

    set QApp = CreateObject("QlikTech.QlikView")

    set QDoc = QApp.OpenDoc "C:\MyOtherDoc.qvw"

    QVar.SetContent QDoc.Variables("vTest").GetContent.String

    QDoc.Close

    QApp.Quit

    set QVar = nothing

    set QDoc = nothing

    set QApp = nothing

End Sub

Or see this blog post: http://www.qlikfix.com/2013/09/06/importing-and-exporting-variables/


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

is there any way to do it without the OpenDoc?