Hello and thanks in advance for the help.

I have some applications which use office automation to read MS Excel files.
Sometimes, if one of these applications has an unexpected termination, I am
left with an orphan Excel process. Is there any way to kill these processes
programatically?

As far as improving the error handling of the code, these are web based apps
which use FoxWeb so I don't really have great error handling available.

Thanks for the help.
Jeff

Re: Orphan Excel Process by Jan

Jan
Wed Jan 17 09:54:27 CST 2007

* You can use WMI, for example close all Calculator instances
oWMI = GETOBJECT('winmgmts://')
cQuery = "select * from win32_process where name='calc.exe'"
oResult = oWMI.ExecQuery(cQuery)
? oResult.Count
FOR EACH oProcess IN oResult
? oProcess.Name
oProcess.Terminate(0)
NEXT



Jeff Grippe napsal(a):
> Hello and thanks in advance for the help.
>
> I have some applications which use office automation to read MS Excel files.
> Sometimes, if one of these applications has an unexpected termination, I am
> left with an orphan Excel process. Is there any way to kill these processes
> programatically?
>
> As far as improving the error handling of the code, these are web based apps
> which use FoxWeb so I don't really have great error handling available.
>
> Thanks for the help.
> Jeff
>
>