From: mickieparis on
Hello, when adding a reference to Excel in a project there are two
choices, one is under the .Net tab for Interop and the other is under
the COM tab. I would like to know the difference between the two. Is
there a good tutorial somewhere?

Basically I have data from SQL db in a datatable and I just need to
update a few cells in an existing excel spreadsheet. I tried to use
ADO.net and Oledb but that requires setting up the spreadsheet a
certain way (like a table with row headers) and the spreadsheet is not
setup like that.

Thanks,
Michelle

From: Gregory A. Beamer on


"mickieparis" <mickieparis(a)gmail.com> wrote in message
news:f0a83b23-84e3-4615-ab38-792971764aa6(a)j17g2000yqa.googlegroups.com...
> Hello, when adding a reference to Excel in a project there are two
> choices, one is under the .Net tab for Interop and the other is under
> the COM tab. I would like to know the difference between the two. Is
> there a good tutorial somewhere?
>
> Basically I have data from SQL db in a datatable and I just need to
> update a few cells in an existing excel spreadsheet. I tried to use
> ADO.net and Oledb but that requires setting up the spreadsheet a
> certain way (like a table with row headers) and the spreadsheet is not
> setup like that.

If you add a COM component reference, it will create an interop library, or
what is termed as a ".NET callable wrapper". If an interop assembly is
provided by the manufacturer, it is generally the best way to go, as they
may have optimized certain things that tlbimp.exe will not do (the tool you
can create a .NET callable wrapper with and the tool VS uses to create the
assemblies called interop).

--
Peace and Grace,
Greg

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

************************************************
| Think outside the box! |
************************************************

From: mickieparis on
Well, in this case the Mfg. is Microsoft. As I said, I just need to
update a few cells with some values but there are two choices when
added a reference. Which one should I use?

Michelle
From: Peter Duniho on
mickieparis wrote:
> Well, in this case the Mfg. is Microsoft. As I said, I just need to
> update a few cells with some values but there are two choices when
> added a reference. Which one should I use?

As Gregory explained, a specific .NET interop library is generally
preferable over a COM library.