473,396 Members | 1,738 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,396 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 2131
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.