Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel Interop + MVC [closed]

Is it safe to use Excel Interop inside MVC app?

like image 210
c.sokun Avatar asked Jan 25 '11 07:01

c.sokun


People also ask

How do you end a process in Excel?

Close all workbooks and exit ExcelOn the File tab, click Exit.

How do I use Microsoft Office Interop Excel in .NET core?

Office. Interop. Excel' nuget package, and then add reference to 'Microsoft Excel 16.0 Object Library' (right click the project -> 'Add' -> 'Reference' -> search and add 'Microsoft Excel 16.0 Object Library' ). Click ''Interop.


2 Answers

EPPlus

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

It does not require Excel to be installed on the server. It doesn't use Excel libraries, it is just an API interface to the Open Office XML format (xlsx). XLSX is actually just a a zip file with a folder structure and xml files inside to describe the layout and data of the spreadsheet.

epplus.codeplex.com. The codeplex site has tons of examples plus here's an additional blogpost with more.

Just putting this here as an Actual answer.

like image 106
Jay Stevens Avatar answered Nov 11 '22 04:11

Jay Stevens


Assuming you mean ASP.NET MVC trying to run Excel on the server, the answer is that it's not recommended. Excel is really designed as a desktop app, so running it on a server can cause some problems, as described on in this 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 instantiate and Excel instance. Take a look at www.openxmldeveloper.org

like image 42
Chris Spicer Avatar answered Nov 11 '22 03:11

Chris Spicer