473,320 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Excel Automation

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
Nov 22 '05 #1
12 2127
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.
"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:19****************************@phx.gbl...
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

Nov 22 '05 #2
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.
"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:19****************************@phx.gbl...
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

Nov 22 '05 #3
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 worksessentially the same way. Add a reference to the corresponding Excel .dllas well.
"Greg Chang" <an*******@discussions.microsoft.com> wrote in messagenews:19****************************@phx.gbl...
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

.

Nov 22 '05 #4
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 worksessentially the same way. Add a reference to the corresponding Excel .dllas well.
"Greg Chang" <an*******@discussions.microsoft.com> wrote in messagenews:19****************************@phx.gbl...
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

.

Nov 22 '05 #5
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
"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
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
essentially the same way. Add a reference to the

corresponding Excel .dll
as well.
"Greg Chang" <an*******@discussions.microsoft.com> wrote

in message
news:19****************************@phx.gbl...
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

.

Nov 22 '05 #6
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
"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
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
essentially the same way. Add a reference to the

corresponding Excel .dll
as well.
"Greg Chang" <an*******@discussions.microsoft.com> wrote

in message
news:19****************************@phx.gbl...
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

.

Nov 22 '05 #7
I'd say you're better off going for the ADO approach. See...

http://support.microsoft.com/default...d=kb;ko;257819

The 'traditional' method has problems e.g.
http://support.microsoft.com/default...b;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.

--
For real reply address, lose the cash
www.realuk.co.uk

"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:19****************************@phx.gbl...
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

Nov 22 '05 #8
I'd say you're better off going for the ADO approach. See...

http://support.microsoft.com/default...d=kb;ko;257819

The 'traditional' method has problems e.g.
http://support.microsoft.com/default...b;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.

--
For real reply address, lose the cash
www.realuk.co.uk

"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:19****************************@phx.gbl...
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

Nov 22 '05 #9
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.
"Rob Oldfield" <r$ob@oldfi$eld100.freese$rve.c$o.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I'd say you're better off going for the ADO approach. See...

http://support.microsoft.com/default...d=kb;ko;257819

The 'traditional' method has problems e.g.
http://support.microsoft.com/default...b;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.

--
For real reply address, lose the cash
www.realuk.co.uk

"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:19****************************@phx.gbl...
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


Nov 22 '05 #10
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.
"Rob Oldfield" <r$ob@oldfi$eld100.freese$rve.c$o.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I'd say you're better off going for the ADO approach. See...

http://support.microsoft.com/default...d=kb;ko;257819

The 'traditional' method has problems e.g.
http://support.microsoft.com/default...b;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.

--
For real reply address, lose the cash
www.realuk.co.uk

"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:19****************************@phx.gbl...
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


Nov 22 '05 #11
http://msdn.microsoft.com/vstudio/of...l/excelobj.asp
"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:19****************************@phx.gbl...
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

Nov 22 '05 #12
http://msdn.microsoft.com/vstudio/of...l/excelobj.asp
"Greg Chang" <an*******@discussions.microsoft.com> wrote in message
news:19****************************@phx.gbl...
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

Nov 22 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Ange T | last post by:
Hi there, I'm having pain with the VB behind an Access form. The form is used to create reports in Excel based on the details entered in the form. This has always worked without error on my...
2
by: jeffgeorge | last post by:
I'm currently exporting a form to Excel. Because there are controls and totals in the header, I first have a button for users to convert to a datasheet. Then I use the automated quick office...
7
by: taylor.bryant | last post by:
I am running: Win XP SP2 Excel 2002, Access 2002 (Office XP SP3) Using Visual Basic (not VB.NET) At one point (prior to XP SP2?!? - I can't pin it down), this did not happen and I was easily...
1
by: cybertof | last post by:
Hello, Is there a way to connect (through automation) a c# application to a running Excel 2003 instance on a specific workbook ? In the past, i used to use GetObject(...) function in VB6. ...
17
by: Mansi | last post by:
I need to do some research on how to use excel automation from c#. Does anyone know of any good books related to this subject? Thanks. Mansi
12
by: D. Shane Fowlkes | last post by:
This most likely belongs in another forum but I thought I'd start here. I have a COM Object written in VB6. The DLL will access MS Excel and use it's Object Library to write a customized report...
3
by: Carlos Magalhaes | last post by:
Hey All, I am doing some excel automation using the excel COM. I can do most of the functions and its working well until I come across a formula. I can run a formula and insert the formula...
3
by: Mitchell Vincent | last post by:
Does anyone have some good examples of Excel automation with (VB).NET? I have some Excel spreadsheets that a customer needs parsed out but I've never tried to use Excel programatically before! ...
6
by: a.theil | last post by:
Please help! I need a simple excel automation, just 2 write some files into excel. I do: Dim oXL As Excel.Application Dim oWB As Excel.Workbook Dim oSheet As Excel.Worksheet Dim oRng As...
1
by: Troy | last post by:
I have VB.Net code that opens Excel files and imports data from them. It works fine for all versions up to 2003 and has for over a year. We have users updating to Office 2003 and the Excel...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.