Groups | Blog | Home
all groups > dotnet interop > october 2004 >

dotnet interop : How to create my own interop assembly?


Mansi
10/5/2004 11:49:03 AM
Hi,

I'm trying to automate excel 2000 from c# .NET. I also need for my code to
work on Excel 2000 and 2003. Since there are no PIAs available for office
2000, what steps do I need to follow to create my own interop assembly for
excel 2000. I'm assuming that once I link to this interop assembly, it will
work with the later versions of excel?

It's mentioned in one of the posts that you can use Excel09.obj to create a
dll using
TlbImp Excel9.olb Excel.dll., but what are the steps to do this?

Thanks.

Mansi
Mansi
10/5/2004 10:01:01 PM

Just to give you some backgroud info, I'm trying to automation excel from c#
..NET.
I need to be able to export to excel 2000, 2002, 2003. I will install
excel 2000 and then reference the assembly generated using "TlbImp Excel9.olb
Excel.dll" in my c# .NET code.

Once I reference the generated assembly, I'm assuming that I can create
objects using early binding? Is this true?

Also, should the interop assembly I generate for excel 2000 work with excel
2002 and 2003?

Thanks.

Mansi



[quoted text, click to view]
Mattias Sjögren
10/5/2004 10:08:54 PM

[quoted text, click to view]

That should be the only step required. After that you just reference
the generated assembly.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Mattias Sjögren
10/6/2004 8:19:41 PM

[quoted text, click to view]

Yes.


[quoted text, click to view]

I believe so, yes. See

INFO: Writing Automation Clients for Multiple Office Versions
http://support.microsoft.com?kbid=244167

How To Use Visual Basic .NET for Binding for Office Automation Servers
http://support.microsoft.com?kbid=302902



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Heath Stewart [MSFT]
10/7/2004 2:03:00 AM
For the most part, typelibs (or rather, their implementations) are
backward compatible. COM guidelines dictate that you don't change
managed interface (instead you derive new ones), CLSIDs stay the same,
etc. With Office, these rarely change. As long as the 2000
implementations suit you they should be supported in most cases in 2002
and 2003.

--

Heath Stewart
Software Design Engineer
Developer Division Sustained Engineering
Mansi
10/7/2004 9:53:02 PM
Thanks for the info.

I know this next question should be posted in another discusssion group, but
I need to be able to export a picture/image file from c# to excel. Is there
any way to do this?

Mansi

[quoted text, click to view]
AddThis Social Bookmark Button