I am using Excel Interop. At the beginning of the method I received, I highlight a new instance of the application, and at the end of it I try to free it, but when I look at the TaskManager, I still see that Excel is open.
This is the code:
Class Member: private Excel.Application _app;
Using:
public void MethodApp()
{
_app = new Excel.Application();
....
....
FreeApplicationResources();
}
private void FreeApplicationResources()
{
_app.Quit();
Marshal.ReleaseComObject(_app);
}
MethodApp can run several times and open instances in the same amount as the number of times it called. Why won't Excel close?
source
share