[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


question about opening an excel object

Posted on 2011-10-03
Medium Priority
Last Modified: 2012-05-12
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)

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
Question by:Ollie90
  • 3

Expert Comment

ID: 36902442
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.
LVL 83

Accepted Solution

CodeCruiser earned 2000 total points
ID: 36902451
If you want it to be version agnostic, use the dynamic approach (CreateObject).

Author Comment

ID: 36902469
ok, two different answers :)

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

@CodeCruiser, why CreateObject instead of interop?
LVL 83

Expert Comment

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


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month20 days, 2 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question