
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VBscript error: Object required: 'WScript'
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
- « Previous Replies
-
- 1
- 2
- Next Replies »


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i not use wscript. and funct
good luck, Luis

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Luca,
this helped me so much!
Regards
Peyman


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
can i close this application(i.e. calc.exe) from my script too?
Best Regards
Peyman


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
was there a solution to this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- « Previous Replies
-
- 1
- 2
- Next Replies »