0

I am using the ExcelDataReader.Dataset package to read in .xlsx files and store specific sheets as a DataTable, like so:

public void SelectWorkbookClick(string s)
{
    string fileName = string.Format("{0}\\{1}", WorkbookFolder, Workbook);

    using (var stream = File.Open(fileName, FileMode.Open, FileAccess.Read))
    { 
        using (var reader = ExcelReaderFactory.CreateReader(stream))
        {
            FrontSheet = reader.AsDataSet().Tables[FrontSheetName];
            RearSheet = reader.AsDataSet().Tables[RearSheetName];
        }
    }
}

This works perfectly for reading in sheets, however my .xlsx file has named ranges in which I need to access.

I have had a look around and cannot not find any support for this, does anyone know of anyways I could go around this?

Community
  • 1
  • 1
Alfie
  • 297
  • 1
  • 12
  • Alas its not implemented (yet?) https://github.com/ExcelDataReader/ExcelDataReader/issues/25 – user8728340 Oct 04 '18 at 16:39
  • @user8728340 yeah saw that thread, looks like they never got around to implementing it :( – Alfie Oct 05 '18 at 08:20
  • 2
    Side-Note: Please call `reader.AsDataSet()` once! `var ds = reader.AsDataSet();` then use its tables - HTH ;). – shA.t Oct 08 '18 at 09:39

0 Answers0