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
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.