Have an ASP.NET process that uses interop to Excel COM objects, which
results in a separate EXCEL.EXE instance for each one. Yes, this is
specifically not encouraged by Microsoft because it gets flaky at times, but
that's what my job said to do. I've come up with a pretty good way to keep
Excel under control in 99.9% of the cases. However, every once in a while I
lose control of the Excel object and cannot shut it down.
What I'm looking for is a way to get the PID of each newly invoked EXCEL.EXE
process that is spun off.
I've not been able to figure out how to do that. I'd like to write them all
to a database table and then have a scheduled process go through and kill
them if they are still alive. We have some other ASP.NET and ASP.old apps
that also invoke Excel objects, so I'm trying to keep the killing scoped to
only the Excel objects invoked by my app.
How do I access the PID of a newly invoked Excel object?
TIA