I am opening an excel file from my winform using:
Dim xlsApp3 As Excel.Application
Dim xlsWB3 As Excel.Workbook
xlsApp3 = CreateObject("Excel.Application")
xlsApp3.Visible = True
xlsWB3 = xlsApp3.Workbooks.Open("C:\myfile.xlsm")
Try
Marshal.ReleaseComObject(xlsWB3)
Marshal.ReleaseComObject(xlsApp3)
xlsWB3 = Nothing
xlsApp3 = Nothing
Catch ex As Exception
xlsWB3 = Nothing
xlsApp3 = Nothing
Finally
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
GC.WaitForPendingFinalizers()
End Try
When I look at my task manager, it closes the process, but as soon as I close the excel application window that I open, the process comes back? If I close my whole winform application, thats when the excel process closes. Is the application holding on to the process in memory?