We want to use Microsoft.Office.Interop.Excel in our web application. Everything works fine on our local machines, but on our test machine we're running into problems. It has neither Visual Studio nor Office installed on it.
We're using .NET framework 2.0 and the server is running on Windows Server 2003 with IIS6.
Is there a dll that needs to be installed on the machine or added to the bin of the web application?
You will need to have MS Office and the Office Interop assemblies installed on your server in order for that to work.
I'm pretty sure that you will need to have Office installed on the machine it's runnnig on. At least that's my experience from building desktop apps that uses Office.Interop
Please go through the following URLs for redistribution:
How to make changes in references
This may help your suituation. And also according to the distribution page, you also need to install office also.
OpenXML?
I got it working at the moment to create Office 2007/Open Office spreadsheet files.
- Point to table
- Include column headers - optional parameter
- Detect data type - optional parameter
- Stream to user or save to file system or save to file system then immediately download.
- Outcomes an Excel file with cells that are detected as numbers / strings.
来源:https://stackoverflow.com/questions/564443/excel-dll-for-microsoft-office-interop-excel