In OLE/COM Object Viewer, I found Excel Interface _Worksheet like this.
[uuid(000208D8-0000-0000-C000-000000000046)]
[helpcontext(0x00020010), dual, nonextensible]
dispinterface _Worksheet
{
// :
// :
[id(0x000000c5), propget, helpcontext(0x000100c5)]
Range* Range([in] VARIANT Cell1, [in, optional] VARIANT Cell2);
// :
// :
}
In C#, I rewrite the above code like this.
[ComImport, Guid("00020820-0000-0000-C000-000000000046")]
public class WorksheetClass{}
[ComImport, CoClass(typeof(WorksheetClass))]
[Guid("000208D8-0000-0000-C000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface Worksheet
{
// :
// :
Range Range(object Cell1, object Cell2);
// :
// :
}
but Error...
*******************************************************************
An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Member not found.
*******************************************************************
How Can I .....?
Willy Denoyette [MVP] - 17 Oct 2005 10:44 GMT
> In OLE/COM Object Viewer, I found Excel Interface _Worksheet like this.
>
[quoted text clipped - 36 lines]
>
> How Can I .....?
Not sure why you defining this yourself. Why not use the Office primary
interop assemblies (PIA's)?
Willy.
Uday Takbhate [MSFT] - 19 Oct 2005 20:30 GMT
Office Primary Interop Assemblies
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/h
tml/wrrefofficeprimaryinteropassemblies.asp
Office 2003 Update: Redistributable Primary Interop Assemblies
http://www.microsoft.com/downloads/details.aspx?FamilyId=3C9A983A-AC14-4125-
8BA0-D36D67E0F4AD&displaylang=en
Hope this is helpful!
Uday Takbhate [MSFT]
--------------------
>From: "Willy Denoyette [MVP]" <willy.denoyette@telenet.be>
>References: <#Mlh6mY0FHA.1924@TK2MSFTNGP14.phx.gbl>
[quoted text clipped - 58 lines]
>
>Willy.