<p>I'm needing to access Excel workbooks from .Net. I know all about the different ways of doing it (I've written them up in a <a href="http://blog.functionalfun.net/2008/06/reading-and-writing-excel-files-with.html" rel="noreferrer" title="Reading and Writing Excel files in .Net">blog post</a>), and I know that using a native .Net component is going to be the fastest. But the question is, which of the components wins? Has anybody benchmarked them? I've been using Syncfusion XlsIO, but that's very slow for some key operations (like deleting rows in a workbook containing thousands of Named ranges).</p>

[{'answer_id': 14534, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': "<p>Can't help you with your original question, but are you aware that you can access Excel files using an OleDbConnection, and therefore treat it as a database? You can then read worksheets into a DataTable, perform all the changes you need to the data in your application, and then save it all back to the file using an OleDbConnection.</p>\n"}, {'answer_id': 19672, 'author': 'Samuel Jack', 'author_id': 1727, 'author_profile': 'https://Stackoverflow.com/users/1727', 'pm_score': 4, 'selected': True, 'text': '<p>I haven\'t done any proper benchmarks, but I tried out several other components,and found that <a href="http://spreadsheetgear.com/" rel="nofollow noreferrer">SpreadsheetGear</a> was considerably faster than XlsIO which I was using before. I\'ve written up some of my findings in this <a href="http://blog.functionalfun.net/2008/08/which-net-excel-io-component-should-i.html" rel="nofollow noreferrer">post</a></p>\n'}, {'answer_id': 47135283, 'author': 'CAD bloke', 'author_id': 492, 'author_profile': 'https://Stackoverflow.com/users/492', 'pm_score': 0, 'selected': False, 'text': '<p>Yes but I\'m not going to publish them both out of a courtesy to Syncfusion (they ask you not to publish benchmarks), because I\'m not an experienced tester so my tests are probably somewhat flawed but mostly because what you actually benchmark makes a huge difference to who wins and by how much. </p>\n\n<p>I took one of their "performance" examples and added the same routine in EPPlus to compare them. XLSIO was around 15% faster with just straightforward inserts, depending on the row/column ratio (I tried a few), memory usage seemed very similar. When I added a routine that, after all the rows were added, deleted every 10th row and then inserted a new row 2 rows up from that - XLSIO was significantly slower in that circumstance. </p>\n\n<p>A generic benchmark is pretty-much useless to you. You need to try them against each other in the specific scenarios you use.</p>\n\n<p>I have been using EPPlus for a few years and the performance has been fine, I don\'t recall shouting at it.</p>\n\n<p>More worthy of your consideration is the functionality, support (Syncfusion have been good, in my experience), Documentation, access to the source code if that is important, and - importantly - how much sense the API makes to you, the syntax can be quite different. eg. Named Styles</p>\n\n<p>XLSIO</p>\n\n<pre><code>headerStyle.BeginUpdate();\nworkbook.SetPaletteColor(8, System.Drawing.Color.FromArgb(255, 174, 33));\nheaderStyle.Color = System.Drawing.Color.FromArgb(255, 174, 33);\nheaderStyle.Font.Bold = true;\nheaderStyle.Borders[ExcelBordersIndex.EdgeLeft]  .LineStyle = ExcelLineStyle.Thin;\nheaderStyle.Borders[ExcelBordersIndex.EdgeRight] .LineStyle = ExcelLineStyle.Thin;\nheaderStyle.Borders[ExcelBordersIndex.EdgeTop]   .LineStyle = ExcelLineStyle.Thin;\nheaderStyle.Borders[ExcelBordersIndex.EdgeBottom].LineStyle = ExcelLineStyle.Thin;\nheaderStyle.EndUpdate();\n</code></pre>\n\n<p>EPPlus</p>\n\n<pre><code>ExcelNamedStyleXml headerStyle = xlPackage.Workbook.Styles.CreateNamedStyle("HeaderStyle");\nheaderStyle.Style.Fill.PatternType = ExcelFillStyle.Solid; // &lt;== needed or BackgroundColor throws an exception\nheaderStyle.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(255, 174, 33));\nheaderStyle.Style.Font.Bold = true;\nheaderStyle.Style.Border.Left.Style   = ExcelBorderStyle.Thin;\nheaderStyle.Style.Border.Right.Style  = ExcelBorderStyle.Thin;\nheaderStyle.Style.Border.Top.Style    = ExcelBorderStyle.Thin;\nheaderStyle.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/14453', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1727/']