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
Jack QasimPosted Jul 4, 2025, 4:53 AM
Use
ExcelPackagefrom EPPlus:Leon DPosted Jul 3, 2025, 1:39 AM
Try this code:
Keep in mind that EPPlus does not support the old .xls format. If you wish to read data from both .xls and .xlsx files, you can use the following approach provided by Spire.XLS library:
Prasad RaveendranPosted Jun 21, 2025, 11:16 PM
Try this approach
sasikala sPosted Jun 20, 2025, 6:00 AM