What is this exception ?
- by Lalit
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)).