Avatar of Ollie90
Ollie90Flag for United States of America

asked on 

question about opening an excel object

i need to make a simple program that loops though a list of excel files and copy/past 1 row to a master excel sheet.

i see that i have several options to create excel objects:

* using a connectionstring OLEDB
* use Excel Reference (Microsoft.Office.Interop.Excel)
* CreateObject("EXCEL.APPLICATION")

What's the best way to do this? i want the option that is less dependent on the excel version of the end user (so it should work on both Excel 2007 and Excel 2010). And i don't want to install extra drivers like a OLEDB connector.

I have Excel 2010 installed on my laptop, endusers have Excel 2003 or Excel 2007
Visual Basic.NET

Avatar of undefined
Last Comment
Nasir Razzaq
Avatar of raysonlee
raysonlee

I'd suggest using MS Office Interop. The latest version is backward compatible. Copy / paste of a row for Excel 2003 - 2010 should not have any problem.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Ollie90
Ollie90
Flag of United States of America image

ASKER

ok, two different answers :)

my first thought was also interop because of the backward compatible ..

@CodeCruiser, why CreateObject instead of interop?
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Microsoft does not guarantee that the Office PIAs will be backwardly compatible


http://support.microsoft.com/default.aspx?scid=kb;en-us;840585
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

96K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo