473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to get PID of invoked COM object?

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
Nov 20 '05 #1
1 2034
if you follow the following guidelines,

http://support.microsoft.com/kb/257757/

then excel should be running under a private userid. you can just walk the
process list looking for excel.exe under that user.

-- bruce (sqlwork.com)

"Joe Schmoe" <Jo********@hamstervision.com> wrote in message
news:sXMef.11442$ih5.8024@dukeread11...
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

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Charles Jamieson | last post by:
I declare a class class myClass{ public: ~myClass();
1
by: Robin Dindayal | last post by:
Does anyone know how I can print a fully rendered .aspx to the server's printer? I know that, if I wanted to print to the client's printer it would be easy (ie. use javascript's window.print()). ...
1
by: John F | last post by:
Hello, I'm dynamically loading a child form saved in a DLL. I have this code working and it's pretty straightforward. What I'd like to do is pass an object type to an invoked method in the...
31
by: Zytan | last post by:
Everything (er, every class) in C# has ToString() which is conveniently automatically invoked when using it in Debug.WriteLine() or in a string concatenation, etc. I made a struct, and I want to...
13
by: sam_cit | last post by:
Hi Everyone, I have the following unit to explain the problem that i have, class sample { public : sample() { printf("in sample...\n"); }
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.