I have written a winform app that outputs to an Excel file. I am failing to properly clean up afterwards, however, since I always end up with way too many Excel processes running. Here is the creation and destruction code:
Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();
Workbook wb = xlApp.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
Worksheet ws = (Worksheet)wb.Worksheets[1];
...
wb.Close();
xlApp.Quit();
Can someone tell me what I am missing?
Regards.