问题
When I use the microsoft.office.interop.excel
to create Excel file, I always call the quit
command at the end. However, more than ever, if I look into the process list of Windows Task manager, I can clearly see that the process is still there and I end up with a bunch of those after a while.
I guess this isn't that much of a problem on normal case, but I would still like to prevent that from happening every time.
Is there any way to do this ?
I can't go on and kill all Excel process because some of them might really be application running and I can't really tell the difference between the two.
Thanks.
回答1:
Notorious offender(automation)! To completely close the process you call Marshal.FinalReleaseComObject({com object}) for all Word and Excel objects.
来源:https://stackoverflow.com/questions/13367534/microsoft-office-interop-excel-stays-in-process-list