Search code examples
epplus

Is it possible to get a data from an excel file from a particular table if I have two tables in one worksheet using EPPlus?


I have a file that contains a few tables on one worksheet. How do I get data from a particular table using EPPlus? thanks a lot

I looked through samples and questions on stackoverflow


Solution

  • You can reference tables by index or by name using this:

    var x = new OfficeOpenXml.ExcelPackage(new FileInfo(@"c:\FooFolder\Bin_Template.xlsx"));
    var table = x.Workbook.Worksheets[1].Tables["Table1"];