|
-
December 9th, 2008, 09:37 AM
#1
How to check Validity of a COM Object
How to check Validity of a COM Object
Hi,
I was trying to Automate MS Excel, I want to check the validity of a COM Object in C#. For Instance, after releasing a sheet Object using "Marshal.ReleaseComObject(m_oSheets)" Sheet object is not equal to null. How to check a COM Object is valid or not.
Thanks in Advance.
//sample code
Excel._Application m_oApplication;
Excel.Workbooks m_oWorkBooks;
Excel._Workbook m_oWorkBook;
Excel.Sheets m_oSheets;
Excel._Worksheet m_oWorkSheet;
Marshal.ReleaseComObject(m_oSheets);
if (m_oSheets == null)
{
......
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|