Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
madushanfernand
Contributor III
Contributor III

Open qvw using vb script

Hi All

 

i found this code somewhere in blog to Open QlikView application, reload, press a button and close.

and it specifically said to put the code in a .vba file.

but i don't know where to write this code and how to execute this. can someone please help me to clear this.

 

Set MyApp = CreateObject("QlikTech.QlikView") Set MyDoc = MyApp.OpenDoc ("C:\QlikViewApps\Demo.qvw","","") Set ActiveDocument = MyDoc ActiveDocument.Reload Set Button1 = ActiveDocument.GetSheetObject("BU01") Button1.Press MyDoc.GetApplication.Quit Set MyDoc = Nothing Set MyApp = Nothing

9) Delete file

1 Reply
trdandamudi
Master II
Master II

The code you pasted belongs to Excel macro. Meaning you need to copy the below lines to the macro window in Excel and then run the code in Excel:

Set MyApp = CreateObject("QlikTech.QlikView")
Set MyDoc = MyApp.OpenDoc ("C:\QlikViewApps\Demo.qvw","","")
Set ActiveDocument = MyDoc ActiveDocument.Reload
Set Button1 = ActiveDocument.GetSheetObject("BU01") Button1.Press
MyDoc.GetApplication.Quit
Set MyDoc = Nothing
Set MyApp = Nothing

Once you run the above code in Excel, it will refreshes the dashboard "Demo.qvw" by clicking on the button. Hope this helps.