Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find the extents of my data in an Excel file (.XLSX) using EPPlus?

Given an Excel spreadsheet, how do I find the extents of the data? Is there a method I can call or a property I can check? Do I need to check cell-by-cell for nulls and then row-by-row? There's gotta be an easier way, right?

I just downloaded the EPPlus library this morning so I might be overlooking something basic. I also checked the sample project but didn't see anything related to this question in it.

Thanks!

like image 583
DenaliHardtail Avatar asked Feb 08 '11 18:02

DenaliHardtail


People also ask

Does EPPlus work with XLS?

EPPlus does not work with the XLS format. Only XLSX. You'll need to find a new library.


1 Answers

Using the Excel Object Model, you'd use Worksheet.UsedRange for that.

Using EPPlus, you'd use WorkSheet.Dimensions.Start.Row / End.Row / Start.Column / End.Column.

like image 93
Paul-Jan Avatar answered Sep 22 '22 21:09

Paul-Jan