infinite shell problem

cfkorea

New Member
Joined
Sep 4, 2013
Messages
13
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?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi cfkorea,

I am using the shell function and I am having the same problem.
On my laptop it will work fine (it is using office 2010) and on another one running office 2007 it will open endlessly the external application.

Did you find the answer to your problem?

Thanks in advance.

 
Upvote 0
Hi benbel.

I asked about this problem on many forums, and I found that there is no solution for this one.
We can't control the chain of calculation in Excel... I heard. So I decide to use Just Re entering Formulas, and make a macro to do that work.

I'll glad if you find other answer to this problem. Thank you.
 
Upvote 0

Forum statistics

Threads
1,216,731
Messages
6,132,390
Members
449,725
Latest member
Enero1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top