What is this exception ?

Posted by Lalit on Stack Overflow See other posts from Stack Overflow or by Lalit
Published on 2010-05-11T13:08:38Z Indexed on 2010/05/11 13:44 UTC
Read the original article Hit count: 608

Filed under:
|
|
|

I am getting this exception while reading the shapes in excel sheet in c#: on code line of

if (worksheet.Shapes.Count >= iCurrentRowIndex)
{}

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel._Worksheet'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D8-0000-0000-C000-000000000046}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).

© Stack Overflow or respective owner

Related posts about com

Related posts about .NET