How to release excel process?

前端 未结 3 1463
悲&欢浪女
悲&欢浪女 2020-12-20 03:43

I\'m using the Excel interop and it seems to be creating a process every time I call

new Microsoft.Office.Interop.Excel.Application()

And n

3条回答
  •  一向
    一向 (楼主)
    2020-12-20 04:13

    Most of the time this happens because you did modify the document and Excel is waiting for some saving. Try something like:

    ObjWorkBook.Close(Microsoft.Office.Interop.Excel.XlSaveAction.xlDoNotSaveChanges, 
        Type.Missing, Type.Missing);
    

    before quitting

提交回复
热议问题