Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

WaitForIdle or Sleep

Let's take a look into documentation:

Sleep - Pauses QlikView for a specified time.

WaitForIdle - Holds macro execution until all layout entities have been updated.

Both of them are for pausing your application. I used to use WaitForIdle, but today I've got very strange behavior. I'm using QV for aggregation and exporting data into Excel files, like this:

set obj = ActiveDocument.GetSheetObject("CH01")

... loop start ...

     ... doing some selections ...

     obj.ExportBiff "C:\test.xls"

     ActiveDocument.GetApplication.WaitForIdle

... loop end ...

I do this in a loop. When an Excel file is not so big, it works fine. But if the file is huge, like 10 tabs with 65,536 records in each, the Excel saving time is longer then WaitForIdle (so, QV is faster ), then my dashboard is just sticking.

So, I've replaced WaitForIdle by ActiveDocument.GetApplication.Sleep 60000*5 and it works fine with even big files.


Resume, WaitForIdle has no idea for any background QV processes. It's doing exactly what it is said in the documentation - 'Holds macro execution until all LAYOUT entities have been updated.' If there is no any layout changes (my chart object is minimized), your application will not pause at all.

0 Replies