|
-
Feb 3rd, 2004, 11:01 AM
#1
Thread Starter
New Member
Process ID
I am using Visual Basic .NET to create a program that instantiates an Excel application object. How do I retrieve the Process ID of this instance of Excel?
The reason I am asking this is because there seems to be a problem with Visual Basic .NET when trying to detroy an Excel object. It would not close it properly, and therefore leaves the application open without a window in the TaskBar. If I can retrieve the Process ID of the Excel application instance I create in code, then perhaps I can kill it via code also.
Thanks in advance!
-
Feb 3rd, 2004, 06:56 PM
#2
Did you call the Quit method of the Excel object? That should close it out.
-
Feb 4th, 2004, 04:21 AM
#3
Sleep mode
As Edneeis said , Close method should work . Get the current process , I think , will not show any info about inner object that your process creates . But , you can try the combination of Close and GC.Collect which fires the Garbage Collector at once .
-
Feb 4th, 2004, 01:16 PM
#4
Thread Starter
New Member
Quit will close the application on the front-end, but the Excel process is still running under the Task Manager.
We tried using the GC.Collect method, but to no avail. I thought it's suppose to prompt the Garbage Collector to clean up all the unused objects immediately, but that doesn't seem to be the case.
Thanks for the advice though.
-
Feb 4th, 2004, 01:24 PM
#5
Sleep mode
As another idea (never tried it) , start Excel object processing in another thread , when you're done , use abort to kill the process .
-
Feb 4th, 2004, 01:43 PM
#6
Try setting the Excel object to nothing.
-
Feb 8th, 2004, 01:00 PM
#7
Thread Starter
New Member
Process ID [RESOLVED]
Thanks for all the advice. I'll let you know what happens. I'm going to try using another thread to start Excel.
Take care!
-
Jul 27th, 2004, 03:57 PM
#8
Addicted Member
what is the best way to do this. I to get the same thing. I do not want to quit the app because the user might need to add notes or maniplate the data. How else does vb.net release hold of the app without quitting (and setting 'oxl=nothing' does not work)
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|