Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am looking for a c#/.net excel parsing library that can deal with files upload

ID: 657295 • Letter: I

Question

I am looking for a c#/.net excel parsing library that can deal with files uploaded from end users, that may have quirks

We are currently using ExcelDataReader but it has some serious shortcomings when dealing with excel files from the wild.

I am looking for an excel parser that can:

Handle files in memory stream, and parse them to a net type
Be able to process 2000+ rows
support 1900/1904 (pc/mac) date formats
Be able to at least some extent without errors handle merged cells
Be able to at least some extent without errors handle formula fields
Be able to at least some extent without errors handle collapsed columns

Nice to have:

Be able to open xls, or other formats
Have a decent performance
still an active project

It would be OK if this was a paid product, but in that case it would be hard if it did not have a demo

Explanation / Answer

Best library our company have been using is closedxml

You declare and initialize the object with the constructor. Collect your data, put them in your datatable, and convert your datatable to excel. Performance is pretty good. In case you use example million lines, i would prefer to add new sheets, in case excel wont go for Overflow in RAM. Best thing, it is free, open source.

XLWorkbook wb = new XLWorkbook();
DataTable dt = GetDataTableOrWhatever();
wb.Worksheets.Add(dt,"WorksheetName");