microsoft.office.interop.excel stays in Process list

◇◆丶佛笑我妖孽 提交于 2019-12-24 07:37:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!