I am new to epplus, and i\'m trying to read some values from an excel table.
This is what I have so far:
var fileInfo = new FileInfo(filename);
using(var e
I had the same issue and I solved it using the ExcelTable
to get the table boundary and the ExcelWorksheet
to retrieve the data. So your code will look something like this:
var fileInfo = new FileInfo(filename);
using(var excelPackage = new OfficeOpenXml.ExcelPackage(fileInfo))
{
foreach (var sheet in excelPackage.Workbook.Worksheets)
{
foreach (ExcelTable table in sheet.Tables)
{
ExcelCellAddress start = table.Address.Start;
ExcelCellAddress end = table.Address.End;
for (int row = start.Row; row <= end.Row; ++row)
{
ExcelRange range = sheet.Cells[row, start.Column, row, end.Column];
...
}
}
}
}
You need to check for table header or other things, but that did the trick for me.