How to get a specific Excel object library without an installed version of Office

I am developing an Excel automation application that reads and writes to an Excel spreadsheet. I have Office 2007 installed on my machine. Therefore, I can reference the Excel 12.0 object library and the Excel 5.0 object library. I do not want to use Excel 5.0 because it is really quite old and poorly documented. Therefore, I refer to Excel 12.0.

However, Office 2003 is installed on the target computer and therefore only has Excel 11.0. Therefore, when I compile my program, it crashes on the target computer, since the link library is different.

I was wondering if there is a way to get Excel 11.0 without installing Office 03? I tried to find the answers on the msdn and microsoft support page but could not find anything? This is rather strange, as it can happen in the future when developers have newer versions of Office than clients?

+3
source share
4 answers

Take a look at my open source MS Office Wrapper for .NET project . An instance of an Office application object is created dynamically using the "CreateObject" method, and then the late binding ability is used, so you do not need a "strong link" to any version of MS Office libraries.

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

Source code is also available.

+2

. Office PIA (2007). Office 2003.

Excel .

PIA 2007 (2003) Excel.

MS Office Wrapper .NET .

+2

SpreadsheetGear. excel. , Excel ( ) . ​​

I use Excel Viewer 2003 because version 2007 has a printing error (when printing, you can open a dialog with a file)

+1
source

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

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

0
source

Source: https://habr.com/ru/post/1743388/


All Articles