Tuesday, July 1, 2014

I am new to Microsoft.Office.Interop.Excel Marshal.ReleaseComObject

Hi


I am new to Microsoft.Office.Interop.Excel


if I create following instance of types.


Workbooks books = Excel.WorkBooks;

Workbook book = books[1];

Sheets sheets = book.WorkSheet;

Worksheet ws = sheets[1];


how to release all objects?


Can I only use:


Marshal.ReleaseComObject(books);


Or


Marshal.ReleaseComObject(sheets);

Marshal.ReleaseComObject(books);


No comments:

Post a Comment