AW: Fremdprogramm aus Excel starten
13.08.2005 14:31:04
Gerhard
Hallo Norman,
danke für Deinen Tipp!
Ich komme allerdings nicht ganz klar mit dem Programm.
zur Info:
mein Fremdprogramm steht unter:
C:\EUFIBU\efibu.exe
Das Programm von Michael Schwimmer mit meiner Adaptierung (lediglich wo steht - original war:) sieht so aus:
Private Const PROCESS_QUERY_INFORMATION = &H400
Private Const STILL_ACTIVE = &H103
Private Declare
Function GetExitCodeProcess Lib _
kernel32 (ByVal hProcess As Long, _
lpExitCode As Long) As Long
Private Declare
Sub Sleep Lib "kernel32" (ByVal _
dwMilliseconds As Long)
Private Declare
Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Sub StartenUndWarten(efibu As String) 'original war:
Sub StartenUndWarten(Programmname As String)
'
Sub StartenUndWarten()
Dim hwndShell As Long, hwndProzess As Long
Dim lngLäuft As Long
hwndShell = Shell("c:\eufibu\efibu.exe", 1) 'original war: hwndShell = Shell("c:\eufibu\efibu.exe", 1)
hwndProzess = OpenProcess(PROCESS_QUERY_INFORMATION, _
0&, hwndShell)
Do
GetExitCodeProcess hwndProzess, lngLäuft
'ev.
Sleep 100
Loop While lngLäuft = STILL_ACTIVE
End Sub
Weisst Du vielleicht was ich falsch mache ?
Danke!
mfg Gerhard