1
Answer

How to Read Data from Excel File in C# Using EPPlus?

Photo of Mia Smith

Mia Smith

1d
90
1

Hi everyone,
I'm trying to read data from an Excel file (.xlsx) using C# and the EPPlus library. I was able to load the file, but I'm not sure how to read specific cells or loop through rows and columns properly.

Here’s a quick look at what I’ve tried:

using (var package = new ExcelPackage(new FileInfo("sample.xlsx")))
{
    ExcelWorksheet sheet = package.Workbook.Worksheets[0];
    // Not sure how to read rows/cells here
}

Can someone please guide me with a simple example of reading rows and columns using EPPlus?
Thanks in advance!

Python

Answers (1)