Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Messagebox

Hey,

Ive got another question :

I'm using Qlikview 10 and i'm writing a macro which generates charts in excel and pdf files.

I'm showing a messagebox in my macro but i want that the messagebox dissapears in 5 seconds

if nobody clicks on the button "OK".

I tried :

WsShell.Popup("Loading charts", _

'5)

ActiveDocument.GetApplication.WaitForIdle 5000

I just want the script to wait a few seconds so it can generate my charts, if not i get a white rectangle instead of a chart.

If i work with a messagebox and i click on "OK" it generates my charts.

So any suggestions to make this work?

If you don't understand my question feel free to ask

Hope someone can help me

13 Replies
Anonymous
Not applicable
Author

Hi

I Try out to find the solution for your problem and i got the solution .

But this script's will be working only in the Macro Debug mode(Click Debug button  from Macro Edit Module and

check).

Solution 1:

Sub MessageBox

Set oWScript = CreateObject("WScript.Shell")

For i = 1 to 1

oWscript.popup "Hi" ,1 

Next

Set oWScript = nothing

End Sub

Solution 2:

Sub Messagebox

CreateObject("WScript.Shell").Popup "Hello", 2, ""

End Sub

Just copy and paste it your qlikview and create one macro button with the name of Messagebox and click the

debug button from edit module macro.

Then you will understand the problem in qlikview application .

Regards

Ashok.

Not applicable
Author

Thx for the quick respons

I already tried those solutions but i only get a messagebox/Popupbox but it wont dissappear

(only if i click the OK button)

Anonymous
Not applicable
Author

Hi

     I hope is this not  possible to close the message box based on the time period in qlikview application.

Redards

Ashok

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You can have try by creating the Text object with ok and cancel button over it and set variable value in that button.

     Show and hide those objects using macro based on time(using conditional option of those objects with a variable name)

Celambarasan

Not applicable
Author

so you mean that it isnt possible to close the messagebox automatically after a time period?

and why is the

ActiveDocument.GetApplication.WaitForIdle

not working?

Because my macro has to wait a bit before qlikview generates the charts.

I tried,

Sleep

wait

etc..

Nothing helped,

only if i put a messagebox in my script and if i click "OK" the chart is generated correctly.

But because its a macro who needs to run at night without userhelp, i can't use that messagebox

Regards

Quintenl

Not applicable
Author

i don't understand what you mean

can you give an example or code?

Thx!

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Did you tried with

     ActiveDocument.GetApplication.Sleep 10000

Not applicable
Author

Yes,

The application waits then but after that time the application generates

the charts in excel, but we only get a blank(white) chart.

And when we use the button and click "OK" we got the real chart

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Then try using this sleep function without that msg box

Function Sleep(seconds)

     elapsed = TimeSerial(0,0,seconds)

     startTime = Time()

     endTime = TimeValue(startTime) + TimeValue(elapsed)

     While endTime > Time()

         '

     Wend

End Function

Celambarasan