Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Wscript.Shell Run vbs Fails?

OK - What am I doing wrong?

'Move Files To Their Archive Locations
Dim movScrpt As Object
Set movScrpt = CreateObject("Wscript.Shell")
movScrpt.Run "\\ServerName\Enterprise Forecasting & Scheduling
Team\MoveReports.vbs"


I get a Run-Time error '-2147024894(80070002)':
Method 'Run' of object 'IWshShell3' failed
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default Wscript.Shell Run vbs Fails?

You might want to check VBA's help regarding the 'Shell' function. That
would probably be a better option that having to create an instance of
"Wscript.Shell". In fact, if your vbs file is simply using the
"Scripting.FileSystemObject" to move files, you might consider doing the
same thing from within VBA and avoid messing with the vbs file.

To answer your question though, whether you use WScript.Shell or the Shell
function, the executable you want to run is either wscript.exe or
cscript.exe with the vbs file passed to the executable as an argument.

Steve



"RayportingMonkey" wrote in
message ...
OK - What am I doing wrong?

'Move Files To Their Archive Locations
Dim movScrpt As Object
Set movScrpt = CreateObject("Wscript.Shell")
movScrpt.Run "\\ServerName\Enterprise Forecasting & Scheduling
Team\MoveReports.vbs"


I get a Run-Time error '-2147024894(80070002)':
Method 'Run' of object 'IWshShell3' failed



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA equivalent for WScript.Sleep urkec Excel Programming 3 April 8th 07 09:22 AM
WScript.Shell Dani Excel Programming 4 October 11th 06 04:20 PM
WScript.Echo... VBA Reference? John Keith[_2_] Excel Programming 3 July 8th 06 03:55 PM
using WScript.CreateObject("Wscript.Shell John Keith[_2_] Excel Programming 3 August 30th 05 07:20 PM
WScript object not found (???) Tom Ogilvy Excel Programming 1 July 10th 03 10:59 PM


All times are GMT +1. The time now is 07:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"