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

Announcements
Congratulations to the new Qlik Luminary and Partner Ambassador class! Meet them here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

pls check the macro code

Hi to all,

how to create a new variable in another QVW file by using macro.

I tried like this but it showing error. What i should modify in below code.

Sub NewVar

set UserFile = App.OpenDoc ("Mydoc123.qvw","","")

set v2 =UserFile.CreateVar("vGet")

              ActiveDocument.ClearAll false  

End Sub

Pls any one can share your experience on this.

Regards

Venkat

Labels (1)
1 Solution

Accepted Solutions
kaushiknsolanki
MVP
MVP

Hi,

   Use below code.

Sub NewVar 

set App = ActiveDocument.GetApplication
set UserFile = App.OpenDoc ("Mydoc123.qvw","","")

UserFile.CreateVariable "vGet"

End Sub  

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

1 Reply
kaushiknsolanki
MVP
MVP

Hi,

   Use below code.

Sub NewVar 

set App = ActiveDocument.GetApplication
set UserFile = App.OpenDoc ("Mydoc123.qvw","","")

UserFile.CreateVariable "vGet"

End Sub  

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!