Search code examples
.netexcelcomado.netoffice-interop

Which is the faster way to read an Excel file into a .NET application : ADO.net or Microsoft.Office.Interop.Excel.Application?


I'm reading in a very large Excel file into a VB.net application. The user specifies the file from a file picker at runtime. I'm currently using the Microsoft.Office.Interop.Excel.Application application interface to read in the Excel data cell-by-cell, row-by-row. Like this...

first = Excel.Cells(rowindex, FirstColumnIndex).value

I need to read big Excel files (80000 rows) and the current method takes a long time. I'm wondering if there is a faster way. I know it is possible to read in a file with ADO.net. Is this faster? Is there an even faster way?

Note Obviously, keeping so much data in an Excel file is not idea, but that's where the data that I need (some of it from other places) is being stored.


Solution

  • Thanks for all of the great answers. ADO.Net was way, way, way faster. Like 15 or 20 minutes faster. I posted here wondering if I should bother re-writing the code in ADO.net for minor speed ups. But, the answer is clearly that ADO is much, much faster than Office.Interop as a way to read in Excel files.