Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Msgbox autoclose (macro)

Hi All,

I tried this script but it's not autoclosing the msgbox. Any idea how?

function Test1()

  Set WshShell = CreateObject("WScript.Shell")

  BtnCode = WshShell.Popup("export",1)

End function

Thanks,

Lyn

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

Actually there is a more indirect way of getting it to work anyway by launching mshta.exe:

2017-02-16 04_04_31-Edit Module.png

Then the timeout will work as expected.

Sub ShowExportStart

  CreateObject("WScript.Shell").Run "mshta.exe vbscript:close(CreateObject(""WScript.Shell"").Popup(""Test"",2,""Real%20Time%20Status%20Message""))"

End Sub

View solution in original post

4 Replies
petter
Partner - Champion III
Partner - Champion III

2017-02-16 03_56_38-Edit Module.png

Autoclosing will never work due to a bug that Microsoft don't want to fix in WshShell ... it has nothing to do with QlikView and will never be fixed. It has been complained about for probably much more than 10 years already...

petter
Partner - Champion III
Partner - Champion III

Actually there is a more indirect way of getting it to work anyway by launching mshta.exe:

2017-02-16 04_04_31-Edit Module.png

Then the timeout will work as expected.

Sub ShowExportStart

  CreateObject("WScript.Shell").Run "mshta.exe vbscript:close(CreateObject(""WScript.Shell"").Popup(""Test"",2,""Real%20Time%20Status%20Message""))"

End Sub

Anil_Babu_Samineni

You are written Java script. Can you check how Scripting Engine looks like. It should Javascript

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

amazing! this one works! Thank you!