Reputation: 28336
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
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