Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

Created Unassigned: System.InvalidCastException as soon as NetOffice Excel Addin loads [21702]

$
0
0
I have an Excel Addin using Excel-DNA. I recently update my code to switch from Interop to NetOffice.

My code all compiles fine, but when I start the add-in, I get this exception on the first line of code that executes (doesn't seem to matter which line of code it is):

> System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'NetOffice.ExcelApi.Application'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.

Does anyone have an idea of why this is happening and how I can fix it?

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>