Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
sequential Shell commands?
I'm using ShellExecute to launch 2 executables. The first one has to finish
before the second one can be executed. Is there a way to ensure that they are executed sequentially without using the "Wait" command? Thanks, Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
sequential Shell commands?
http://support.microsoft.com/?id=214248
XL2000: How to Force Macro Code to Wait for Outside Procedure http://support.microsoft.com/?id=129796 HOWTO: 32-Bit App Can Determine When a Shelled Process Ends http://support.microsoft.com/?id=147392 XL: How to Force Macro Code to Wait for Outside Procedure -- Regards, Tom Ogilvy "steve66" wrote in message ... I'm using ShellExecute to launch 2 executables. The first one has to finish before the second one can be executed. Is there a way to ensure that they are executed sequentially without using the "Wait" command? Thanks, Steve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
sequential Shell commands?
Declare The Following API: Public Const PROCESS_QUERY_INFORMATION = &H400 Public Const STILL_ACTIVE = &H103 Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long And Create The Following Subroutine: Sub ShellAndWait(ByVal PathName As String, Optional WindowState) Dim hProg As Long Dim hProcess As Long, ExitCode As Long If IsMissing(WindowState) Then WindowState = 1 hProg = Shell(PathName, WindowState) 'hProg is a "process ID under Win32. To get the process handle: hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, hProg) Do 'populate Exit code variable GetExitCodeProcess hProcess, ExitCode DoEvents Loop While ExitCode = STILL_ACTIVE End Sub ===== * ===== * ===== Daniel CHEN Spreadsheet Specialist www.Geocities.com/UDQServices Download Free Data Processing Add-in ===== * ===== * ===== "steve66" wrote: I'm using ShellExecute to launch 2 executables. The first one has to finish before the second one can be executed. Is there a way to ensure that they are executed sequentially without using the "Wait" command? Thanks, Steve |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
sequential Shell commands?
This source was given to me by Tom Olgilvy for a similar situation back in
September. It worked perfectly: http://support.microsoft.com/?Â*id=129796 HOWTO: 32-Bit App Can Determine When a Shelled Process Ends If it works, don't thank me, thank Tom. Regards, Greg -- Regards, Tom Ogilvy "steve66" wrote: I'm using ShellExecute to launch 2 executables. The first one has to finish before the second one can be executed. Is there a way to ensure that they are executed sequentially without using the "Wait" command? Thanks, Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
running commands from hte shell | Excel Programming | |||
List of commands that work with shell? | Excel Programming | |||
shell commands | Excel Programming | |||
Simple Shell Commands | Excel Programming | |||
Commands at the line prompt using Shell | Excel Programming |