I get an InvalidComObjectException after I close my application in the following piece of code:
class MyExcelManager
{
myExelAppInstance = new Excel.Application();
// finalizer
~MyExcelManager()
{
myExelAppInstance.Quit(); // InvalidComObjectException thrown here
myExelAppInstance = null;
}
}
Why is that? Shouldn't I use finalizers to dispose COM-objects?