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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Module to wait x seconds

Hi I have some code which I would like to include into a macro my Qlikview doc is running, however I continue to get errors which I cant reconcile using google.
Below is a snapshot of my code which is causing trouble and the error it is throwing.

sub  Wait(Byval seconds as integer)

    System.Threading.Thread.Sleep (seconds*100)

End sub

Error: Expected ')'
It highlights the "as integer)" part of this sub.

Any reason this is throwing the error

When I try

sub  Wait(seconds)

    System.Threading.Thread.Sleep (seconds*100)

End sub

nothing happens when I test Wait(5). any ideas on how to fix this?

Ideally I would like to have a sub that makes the program wait 5 seconds when I call Wait(5).

Thank you

1 Reply
Not applicable
Author

I also tried:

sub  Wait(seconds)

    ActiveDocument.GetApplication.WaitForIdle

    ActiveDocument.GetApplication.Sleep (seconds * 1000)

End sub

and nothing happens.

Also

sub  Wait

    ActiveDocument.GetApplication.WaitForIdle

    ActiveDocument.GetApplication.Sleep 5000

End sub

and nothing happens.
Is there a library I have import?