0

Is there a way to read data table with ExcelDataReader using the Excel range (such as A1:B9)?

I am looking for something like:

        string tableName = "MyTable";
        string range = "A2:B9";
        using (var stream = File.Open(@"d:\temp\lte80k.xlsx", FileMode.Open, FileAccess.Read))
        {
            using (var excelDataReader = ExcelReaderFactory.CreateReader(stream))
            {
                var filteredTable = excelDataReader.GetTable(tableName, range);

                // some processing here...
            }
        }

I can see that there is a class ExcelDataReader.CellRange, but cannot figure out how to use it.

2
  • CellRange is only used to support the MergeCells property. Commented Dec 19, 2019 at 18:23
  • Once you have the data into in a array you could do something like result.Tables[0].Rows[rowPosition][columnPosition] look at this question stackoverflow.com/questions/27634477/… cesAR answer may be helpful to you. Commented Dec 19, 2019 at 18:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.