tags:

views:

291

answers:

5

I am developing a Excel automation app that read and write to Excel spreadsheet. I have Office 2007 installed on my machine. I therefore can reference the Excel 12.0 Object Library and the Excel 5.0 Object Library. I don't want to use Excel 5.0 because it's really quite old and poorly documented. Therefore I'm referencing Excel 12.0.

However the target machine have Office 2003 installed and therefore only have Excel 11.0. So when I compile my program it crashes on the target machine since the referenced library are different.

I was wondering is there a way I could obtain the Excel 11.0 without installing Office 03? I tried to find answers from msdn and microsoft support page but couldn't find anything? This is quite strange since it could also happen in the future where developers has newer editions of Office than clients?

A: 

You'll need to download and install the Office Interop Assemblies for the version(s) of Office you need.

For Office 2003, download from here
For Office 2007, download from here

Jay Riggs
+1  A: 

I am pretty happy with SpreadsheetGear. This component allows you to read and write excel files. I am using it for reporting, client machine has only Excel Viewer (which is free) to read files and print them.

I am using Excel Viewer 2003 because 2007 version has a printing bug (on print it's promt you open file dialog)

volody
A: 

An alternative would be to use a component that supports reading and writing excel spreadsheets, thus removing the dependency. I found this a more straightforward solution in the past for both development and deployment.

I used:

http://www.syncfusion.com/products/reporting-edition/xlsio

chibacity
A: 

Look at my open source project MS Office Wrapper for .NET. The instance of Office application object is created dynamically via "CreateObject" method and then is used late-binding ability, so you don't need any "strong reference" to any version of MS Office libraries.

You can use C#, VB.NET, J#, etc...

The source code is available too.

TcKs
+1  A: 

You don't really have to fight so strong. Just include into distribution package latest Office PIA (2007). It backward compatible with Office 2003.

Please read Excel product team blog and detailed answer about compatibility here.

We include 2007 PIA into distribution and have no any issues with working previous (2003) version of Excel.

MS Office Wrapper for .NET mention here is very nice alternative.

Nick Martyshchenko