Release Excel Object In My Destructor

Posted by Murat on Stack Overflow See other posts from Stack Overflow or by Murat
Published on 2010-01-18T12:28:56Z Indexed on 2010/04/17 11:33 UTC
Read the original article Hit count: 364

Filed under:
|
|
|
|

Hi all,

I'm writing a Excel class using Microsoft.Interropt.Excel DLL. I finish all function but I have an error in my Destructor. I Want to save all changes to my file and I want to release all source. I want to all of them in my destructor. But In my destructor, Excel.ApplicationClass, Workbook and Worksheet objects are fill by an Exception which have message "COM object that has been separated from its underlying RCW cannot be used." So I can't save nothing, close nothing because i can't access workbook or worksheet object.

Can't I access the class private members in Destructor?

© Stack Overflow or respective owner

Related posts about release

Related posts about excel