Excel Interop + MVC

Is it possible to use Excel Interop inside an MVC application?

+6
asp.net-mvc excel-interop
source share
2 answers

EPPlus

EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml (xlsx) format.

No need to install Excel on the server. It does not use Excel libraries, it is just an API for the Open Office XML (xlsx) format. XLSX is actually just a zip file with folder structure and XML files inside to describe the layout and data of the spreadsheet.

epplus.codeplex.com . There are a few examples on the Codeplex site, plus an additional blog post with lots of them.

Just put it here as a real answer.

+3
source share

Assuming you mean ASP.NET MVC trying to run Excel on the server, the answer is that it is not recommended. Excel is really designed as a desktop application, so running it on the server can cause some problems, as described in the MSDN article.

If you can target Excel 2007/2010, a good alternative is to use the Open Office XML libraries to create, read, or modify Excel workbooks without an instance instance and an Excel instance. Take a look at www.openxmldeveloper.org

+2
source share

All Articles