Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA equivalent for WScript.Sleep | Excel Programming | |||
WScript.Shell | Excel Programming | |||
WScript.Echo... VBA Reference? | Excel Programming | |||
using WScript.CreateObject("Wscript.Shell | Excel Programming | |||
WScript object not found (???) | Excel Programming |