COM object excel interop clean up
问题 Lets say that I have one component which is doing something with Workbook object and somewhere in the middle of that method body I have call to some method of another class. For example: public class MainComponent { public void MyMainMethod() { OtherComponent otherComponent = new OtherComponent(); Workbook document; // some work with workbook object // working with document and worksheet objects. otherComponent.MethodCall(document); // some work with workbook object and it's worksheets.