Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a macro that exports an object to a CSV file.
I would like to display a message when the export starts and one when it is done. The first message should not require the user to click ok. So msgbox is not an option.
From the net I plucked this:
Dim WshShell, BtnCode
Set WshShell = WScript.CreateObject("WScript.Shell")
BtnCode = WshShell.Popup("Export started", 10)
The macro doesn't work:
Object required: 'WScript'
Note: security is set to System Access and Allow System Access.
QV 8.5
Any suggestions?
Thanks
Anton
Hi,
i not use wscript. and funct
good luck, Luis
Hi Luis,
Thanks. Now I get the pop-up, but it is waiting for the user to click ok. I does not go away after 10 seconds as it should...
Anton
Hi all,
No solution yet...
Does anyone know of a way to show a message during the execution of a macro that does not require any action from the user?
In other words: showing a message that does not interupt the macro execution?
Thanks
Anton
Hello Anton,
I had the same problem and I solved it by removing the word WScript before CreateObject
'Correct
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("calc.exe")
'NOT Correct
Set WshShell = WScript. CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("calc.exe")
Regards
Luca Jonathan Panetta
Thank you Luca,
this helped me so much!
Regards
Peyman
can i close this application(i.e. calc.exe) from my script too?
Best Regards
Peyman
Hi Peyman,
look these
http://www.excelforum.com/excel-programming-vba-macros/480065-how-to-close-an-application.html
But NOTE that the use of Terminate can generate memory leaks.
Regards
Luca Jonathan Panetta
was there a solution to this?
A tiny modification of the script he found on the internet will make it work in a Module/Macro/VBScript in QlikView:
If you leave out WScript in front of the CreateObject() it will work.
Furthermore you have to change these two settings from safe mode in the Edit Module Editor:
Requested Module Security: System Access
Current Local Security: Allow System Access
The code should be wrapped in a sub routine to:
BTW: The timeout that is supposed to work is a bug in the WShell component in Windows. Has nothing to do with QlikView. So putting a value for timeout like 10 seconds will never work... You will have to press a button.