DenaliHardtail
DenaliHardtail

Reputation: 28336

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!

Upvotes: 7

Views: 4611

Answers (1)

Paul-Jan
Paul-Jan

Reputation: 17278

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.

Upvotes: 17

Related Questions