Excel get_Range missing when interop assembly is embedded in .NET 4.0
Posted
by mikemay
on Stack Overflow
See other posts from Stack Overflow
or by mikemay
Published on 2010-02-03T15:19:16Z
Indexed on
2010/05/10
10:44 UTC
Read the original article
Hit count: 889
I build an assembly referencing a COM interop DLL. If I embed the COM interop types by setting Embed Interop Types to True in the Reference's properties (VS2010), at run-time an error occurs "object does not contain a definition for get_Range". If COM interop types are not embedded then no error occurs.
Does anyone know why a particular method, Worksheet.get_Range should be ommitted or how to work around this or have any other relevant insights? I should be grateful for any help.
The interop dll contains a reference to Worksheet.get_Range(object, [object]). Using reflector on my calling assembly there is no mention of get_Range under Worksheet.
The interop assembly I am embedding is generated from Excel9.olb. I am not using PIAs as the application targets multiple Excel versions.
© Stack Overflow or respective owner