Getting Exception Type : InvalidCastException

excel
activities

#1

I am getting This Exception… Below is the Details while Running a Macro Under Excel Application Scope in other computer its working fine… Can anyone help me on this…

Message: Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘Microsoft.Office.Interop.Excel._Workbook’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{000208DA-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)).


#2

Hello there,
Does this help !


#3

NO… This one i have already done… But its not working…


#4

How about implementing dispatcher. it will release unmanaged resources used by your application.
Or something like this using dispose for the reference.

PS: Does both studio has same excel packages version?. Can you update if available and try.
How about using workbook activity not within excel scope.


#5

does your excel macro have Close Application activity? if yes remove it.