Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Running a VB macro from the Load script


I have a VB macro built in the Qlik Module editor.  I have an action button created in my application and will execute the macro just fine.  The macro takes graphs and charts from my qliikview object and creates an excel workbook from them.  I would like for the macro to automaticly execute and run at the end of my load script so I do not have to press the action button to run the macro.  I have tried several different methods, but nothing seems to work.  Can anyone provide step by step instructions to execute a macro from the load script?  New to qlikview.

Macro

sub exportToExcel_Variant2

...

end sub

4 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

QlikView offers the possibility to execute VBS functions from your load script. However that won't fix your problem.

UI objects are only recalculated after the load script terminates. So it will be pretty useless to export "empty" objects.

sebastianlettner
Partner - Creator
Partner - Creator

Hi,

you can add an action ('External' --> 'Run Macro') for 'OnPostReload'.

You find it under 'Document Properties' --> 'Triggers' --> 'Document Event Triggers'

Regards

Sebastian Lettner

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Keep in mind that this won't work in the AccessPoint. On a server, the distribution service is responsible for all document reloads and the distribution service does not care about user interfaces or triggers. It's a black box-style engine.

Not applicable
Author

You can use reload your qvw from command line and use OnPostReload trigger event.

eg "C:\Program Files\QlikView\QV.exe" /l  "qvwfilewithpath"