Alex Rivera | Logout

support different Office versions with Office Automation

Asked 2011-06-21T20:06:19.217
14

We created an application that uses Office 2007 (Excel 2007) to read in data from an Excel worksheet. However. I noticed that when I want to deploy the application on a system with Office 2003 installed, it crashes because other PIA's (and other dll's) need to be referenced for this version of office.

Do I need to compile different versions of my application to be able to support different versions of Office or is there a more elegant solution for this problem?

I use Visual Studio 2010 (C#) and the .Net 4.0 platform.

Edit
Report

1 Answer

1

Depending on whether you have any other requirements (you say reading data from excel), you can use the OLEDB driver to connect to the excel file and query it in a SQL manner.

Example: http://codehill.com/2009/01/reading-excel-2003-and-2007-files-using-oledb/

answered 2011-06-21T20:12:11.523

Your Answer