Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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.


sub exportToExcel_Variant2


end sub

4 Replies

Re: Running a VB macro from the Load script

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.


Re: Running a VB macro from the Load script


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

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


Sebastian Lettner

Re: Running a VB macro from the Load script

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

Re: Running a VB macro from the Load script

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

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

Community Browser