Actually I am writing a small application (WinForms + C #) where I am reading an Excel file. After exiting the application and navigating to the task manager, I found that Excel.exe was still working. And when I ran my application several times, I found several instances of Excel.exe running in the task manager.
So can someone tell me what needs to be done to kill "Excel.exe" every time I exit the application ...
The code looks something like this:
ApplicationClass appClass = new ApplicationClass(); Workbook workBook = appClass.Workbooks.Open(path, 0, true, 5, "", "", true, XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); Worksheet workSheet = (Worksheet) workBook.ActiveSheet;
Everything in this namespace: Microsoft.Office.Interop.Excel; this is COM
source share