Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
running vbs script from vba?
I have a vbs script that I'm trying to run from a vba subroutine in excel
using the "shell" function: cmdstr$ = "cscript w:\simtemp\ctd.vbs" retval = Shell(cmdstr$, vbMaximizedFocus) When this executes, the cscript window opens but the script doesn't run. However when I open a command shell and manually start the script it runs fine: Shouldn't this work or am I missing something? Thanks John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
running vbs script from vba?
This worked for me in Win98:
Option Explicit Sub testme() Dim myScript As String myScript = "C:\My Documents\scripts\DeleteTempFiles.vbs" Shell "start " & Chr(34) & myScript & Chr(34), vbMaximizedFocus End Sub The extra chr(34) were required since my .vbs path had spaces in it. I do see a DOS window, though. John Gunn wrote: I have a vbs script that I'm trying to run from a vba subroutine in excel using the "shell" function: cmdstr$ = "cscript w:\simtemp\ctd.vbs" retval = Shell(cmdstr$, vbMaximizedFocus) When this executes, the cscript window opens but the script doesn't run. However when I open a command shell and manually start the script it runs fine: Shouldn't this work or am I missing something? Thanks John -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
question about some excel restriction script running on ... | Excel Discussion (Misc queries) | |||
question about some excel restriction script running on ... | Excel Discussion (Misc queries) | |||
Running a script while editing a cell | Excel Discussion (Misc queries) | |||
Compile error when running a vba script. | Excel Programming | |||
Running a VB Script | Excel Programming |