I need some help for my excel vba program.
I use ShellRun code to execute external program (***.exe)
Public Sub ShellRun(sCommandLine As String)
Dim hShell As Long
Dim hProc As Long
Dim lExit As Long
hShell = Shell(sCommandLine, vbNormalFocus)
hProc = OpenProcess(PROCESS_QUERY_INFORMATION, False, hShell)
Do
GetExitCodeProcess hProc, lExit
DoEvents
Loop While lExit = STILL_ACTIVE
End Sub
But Sometime When I use this code,
Excel calls external program infinitely many times.
I don't know why because it works well in another computer.
can someone give me some tips or problems to solve this problem?
I use ShellRun code to execute external program (***.exe)
Public Sub ShellRun(sCommandLine As String)
Dim hShell As Long
Dim hProc As Long
Dim lExit As Long
hShell = Shell(sCommandLine, vbNormalFocus)
hProc = OpenProcess(PROCESS_QUERY_INFORMATION, False, hShell)
Do
GetExitCodeProcess hProc, lExit
DoEvents
Loop While lExit = STILL_ACTIVE
End Sub
But Sometime When I use this code,
Excel calls external program infinitely many times.
I don't know why because it works well in another computer.
can someone give me some tips or problems to solve this problem?