Can VSTO projects built using, for example, Microsoft.Office.Interop.Excel be run on machines without Office installed?

StackOverflow https://stackoverflow.com/questions/2052560

Question

We're currently using a thing from SoftArtisans to generate Excel spreadsheets from data the mainframe FTPs down to our document server.

The doc server has the .Net frameworks through 3.5 on it, as does my development box. The difference is my machine has Office 2007 as well.

So, I built a service this morning with a filewatcher using Interop.Excel to make the spreadsheets without the need for the SoftArtisans piece.

When I install and run on the document server, the app chokes when I drop a file in for conversion, saying "Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0"

Is there no redistributable package or something I can use? Management doesn't want Office installed on the server.

Was it helpful?

Solution

As far as I know, the only way to use the Office Interop assemblies, is to have full office client installed on the server.

OTHER TIPS

Nate's answer is correct, in order to use Office's PIAs you need to have the Office package installed. Those PIAs will call the Excel executable (in this case) everytime you ask for an Excel.Application object.

There is more information here, and a workaround to Excel's XML format. That may help you.

SpreadsheetGear for .NET can create / modify Excel workbooks, and also comes with a Windows Forms Spreadsheet Control which can display your Excel workbooks / charts / etc... You can deploy SpreadsheetGear royalty free and it only requires .NET 2.0. There is no dependency on Excel or anything else besides .NET.

You can learn about the SpreadsheetGear WinForms control here and download the free trial here.

Disclaimer: I own SpreadsheetGear LLC

I work for SoftArtisans; can I ask what prompted you to move away from ExcelWriter? It sounds like your situation is a good fit for our ExcelTemplate product, which supports both binary Excel files and the OOXML ones you'd create with the Office interop assemblies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top