Generate Excel file on server without installing Excel

I use Microsoft.Office.Interop.Exceland create Excel files using the method SaveAs. All this works correctly on a computer with Excel installed. However, Excel is not installed on my server.

How can I generate my files?

+3
source share
6 answers

If you are creating a file using Interop, you need to install Excel on the server.

Microsoft does not support the installation of Excel (or Word) on the server. Instead, you must download the Office Open XML SDK from Microsoft and use this library to create Excel 2007 documents. This library does not require Excel to be installed on the server: http://msdn.microsoft.com/en-us/office/ee441239.aspx

+3
source

If you are talking about Excel before MS Office 2010, then there is no set of "client libraries" that you can use to create Office documents.
Interop assemblies are simply .net wrappers around Microsoft unmanaged code that make the Excel API available to .net clients.
You will need to install MSOffice on the server.

EDIT: : Excel dll Microsoft.Office.Interop.Excel

+2
+1

FileHelpers Excel ( ).

"FileHelpers - .NET / , ".

, .

0

If you agree with the new Open Office Xml (xlsx) format, I would highly recommend taking a look at the free .Net EPPlus library . It is easy to use and has tons of features.

0
source

If you just need data in files and charts, etc., I would just go with XML or CSV format. Both are open formats and do not require interactive binaries.

0
source

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


All Articles