Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel file generation on server without Excel installed

I am using Microsoft.Office.Interop.Excel and generating Excel files using the SaveAs method. This all works correctly on computer with Excel installed. However, my server does not have Excel installed.

How can I generate my files?

like image 359
Kumara Avatar asked Dec 07 '25 10:12

Kumara


2 Answers

If you generate a file using Interop you need to install Excel on the server.

Microsoft doesn't support installing Excel (or Word) on the server. Instead you should download the Office Open XML SDK from Microsoft and use that library to generate Excel 2007 documents. This library does not require Excel to be installed on the server: http://msdn.microsoft.com/en-us/office/ee441239.aspx

like image 128
ZippyV Avatar answered Dec 09 '25 22:12

ZippyV


If you are talking about Excel prior to MS Office 2010, there is no set of "client libraries" that can be used to create Office documents.
"Interop" assemblies are just .net wrappers around Microsoft's unmanaged code, that make the Excel API available to .net clients.
You will have to install MSOffice on the server.

EDIT: A similar question here: Excel dll for Microsoft.Office.Interop.Excel

like image 45
naivists Avatar answered Dec 10 '25 00:12

naivists



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!