Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

excel interop alternative

I have started using the Excel interop assemblies that are provided by Microsoft for one of my C# applications. Everything is going fine, but there seems to be a lack of strong typing, and honestly it feels like I am writing VBA code. Are there any alternative ways to interact with Excel from C# that would give a better OO experience? I am using VS2010 and .Net 4.0 by the way.

like image 748
A.R. Avatar asked Aug 09 '11 20:08

A.R.


People also ask

Is OpenXML faster than Interop?

Probably yes, but it really depends on the complexity of the sheet. It is more efficient to use OpenXML SDK then Interop, but the code is a bit more complicated. Also both OpenXML SDK and Excel Interop are third party libraries. If you do not want to use any third party library then you would need to use System.

Does Microsoft Office Interop Excel require Excel to be installed?

Some issues when using Microsoft Office Interop (Excel Automation) from C# or VB.NET are: It requires a license for Microsoft Office on every client machine. It requires all client machines to have the same version of Microsoft Excel installed.

How do I interop in .NET core excel?

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.


1 Answers

Take a look at the EPPlus project over at Codeplex:

http://epplus.codeplex.com/

I recently used this and it worked very well. (VS2010 and .Net4)

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

Nice example page: http://epplus.codeplex.com/wikipage?title=ContentSheetExample

like image 71
Fosco Avatar answered Sep 21 '22 10:09

Fosco