Excel Automation

  • Thread starter Thread starter Greg Chang
  • Start date Start date
G

Greg Chang

I had a VB 6 program that use COM interface to automate
Excel.

What is the best way to work similar thing in .Net VB?
still using COM interface? or there are a better way
(managed codes)?

Please help thanks.

Greg
 
You need to add a reference to system.runtime.INteropservices and it works
essentially the same way. Add a reference to the corresponding Excel .dll
as well.
 
I don't have "system.runtime.INteropservices" in the list
of the .Net Tab of my "Add Reference" windows.
How do I get it there?
-----Original Message-----
You need to add a reference to
system.runtime.INteropservices and it works
 
It should already be included, try just typing it at the top. You'll need
to add a reference to the Excel automation library and you have different
choices 9.0 for instance, depening on which one you want to use.

HTH,

Bill
 
I'd say you're better off going for the ADO approach. See...

http://support.microsoft.com/default.aspx?scid=kb;ko;257819

The 'traditional' method has problems e.g.
http://support.microsoft.com/default.aspx?scid=kb;en-us;317109 which doesn't
work correctly, and the fact that including the additional libraries bloats
the size needed (the msi for a project of mine went from something like 300K
up to 4 meg.

If, by the way, you do continue down the automation route and run into the
problem in 317109 then mail me as I've just figured it out.
 
As someone who's done a lot of Excel Automation in .NET, I have to agree
with Rod. There is a lot of bloat and it can be really slow. However,
sometimes you have to dive into the Excel Library, but I'd avoid it as much
as possible.
 
Back
Top