VIDEOS

How to Read Excel Files in C# using IronXL

Regan Pun
Regan Pun
April 19, 2022
Share:


In this tutorial, we delve into reading Excel files in C# using the IronXL library, which is free for development use. We begin by installing the IronXL package through the package manager console. First, add the namespace 'using IronXL' to your code. Next, load the desired Excel workbook with the 'Workbook.Load' method, specifying the file path and name. Once loaded, you can select the worksheet using 'Workbook.GetWorksheet'. A loop is employed to read data from cells A1 to A10, displaying the values in the console. Additionally, the tutorial demonstrates using aggregate functions to calculate sum and max values from the data range using LINQ. The tutorial concludes by highlighting that similar methods can be employed for other aggregate functions like min and average. For further assistance, the support team is available to help users facing any challenges.

Get stated with IronXL now.
green arrow pointer

Regan Pun
Software Engineer
Regan graduated from the University of Reading, with a BA in Electronic Engineering. Before joining Iron Software, his previous job roles had him laser-focused on single tasks; and what he most enjoys at Iron Software is the spectrum of work he gets to undertake, whether it’s adding value to sales, technical support, product development or marketing. He enjoys understanding the way developers are using the Iron Software library, and using that knowledge to continually improve documentation and develop the products.
< PREVIOUS
How to Manage Excel Worksheets in C#
NEXT >
How to Write an Excel File in C#