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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Executing macro from vbs and wait until finishes

Hi,

I need to do some exports to excel filtering by some different clients and then send them by e-mail following a schedule.

I tried to call the macro from the vbs but I couldn't find the proper way, I looked for in the forum and I got some shell scripts but not vbs, so a workaround is calling the push event from a button that executes the macro.

Is there any other way to call the macro from vbs? it looks strange because lots of things can be done from vbs.

Another problem is the vbs doesn't wait until the macro finishes, so it continue executing other things, I found a workaround using a variable as a traffic light and I do a qvDoc.GetApplication.WaitForIdle 2000 inside a while.

My question is, is there any other more elegant way?

Thank you very much!

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

WaitForIdle is the right way to wait for all calculations to be finished after the previous command.

I'm not sure what you mean by "calling the macro from vbs"?  If you mean "ways of calling a VBScript macro", then you can invoke them from buttons, other objects that can trigger actions, or from document-level and sheet-level triggers.

cheers,

Oleg Troyansky

www.masterssummit.com - take your QlikView skills to the next level!

Ask me about Qlik Sense Expert Class!
Not applicable
Author

Hi,

Although WaitForIdle is ok it does not wait for a macro to be finished.

About the other question yes, I meant that.

Thanks