IRONSOFTWAREHOME

.NET Core Code

C# VB PDF .NET : Read Excel Files in CoreRead Excel Files in Core
using IronXL;
using System;
using System.Linq;

// Supported for XLSX, XLS, XLSM, XLTX, CSV and TSV
WorkBook workBook = WorkBook.Load("sample.xlsx");

// Select worksheet at index 0
WorkSheet workSheet = workBook.WorkSheets[0];

// Get any existing worksheet
WorkSheet firstSheet = workBook.DefaultWorkSheet;

// Select a cell and return the converted value
int cellValue = workSheet["A2"].IntValue;

// Read from ranges of cells elegantly.
foreach (var cell in workSheet["A2:A10"])
{
    Console.WriteLine("Cell {0} has value '{1}'", cell.AddressString, cell.Text);
}

// Calculate aggregate values such as Min, Max and Sum
decimal sum = workSheet["A2:A10"].Sum();

// Linq compatible
decimal max = workSheet["A2:A10"].Max(c => c.DecimalValue);
NuGet Downloads Badge
PM > Install-Package IronXL.Excel

The Load feature in IronXL allows you to easily load and manipulate existing Excel files in various formats (XLSX, XLS, CSV, etc.). By loading a WorkBook, you gain access to its WorkSheets and data, enabling you to extract values, loop through cell ranges, and perform calculations like sums or maximum values. You can access specific cells, convert their values to the appropriate data type (e.g., integers, decimals), and even use LINQ for advanced data operations. This feature simplifies working with Excel data in .NET, making it ideal for tasks like data analysis, report generation, and automation.

The WorkBook object is the key starting point for interacting with Excel files in IronXL. By using the WorkBook.Load("sample.xlsx") method, you open an existing Excel file, gaining access to its content and structure for further manipulation. This allows developers to work with pre-existing data, automate tasks, and update spreadsheets without having to create a new one from scratch.

Next, the WorkSheets[0] property is used to access the first worksheet in the workbook. In Excel, a workbook can contain multiple sheets, each representing a set of data organized into rows and columns. By selecting the first sheet, you're targeting the main area where your data is stored or where you'll perform operations like reading values or calculating results.

The range variable defines a specific group of cells, in this case, the range from A2 to A10. This is where IronXL allows you to interact with multiple cells at once, either by reading values, applying formatting, or performing calculations across ranges. In this example, it captures a column range, making it easy to work with sequential data.

The .Sum() method is used to calculate the sum of the numeric values in the selected range. This highlights how IronXL allows developers to perform quick, built-in calculations on ranges of data, eliminating the need for manual iteration and summing.

Finally, the Console.WriteLine() statement outputs the calculated sum to the console. This is a simple but powerful way to display the result of your operations, such as the sum of values in a range, directly within your application.

With this approach, developers can easily automate data aggregation tasks or integrate them into larger workflows.

Learn to Load and Manipulate Excel Files with IronXL

Technical Support From Our .NET Core Team

Get in touch with our product development and support team. Our team are on hand to answer your questions regarding licensing, product and usage for your project.

Work with Excel Files in .NET Core

A quick and easy approach to work with Excel and other Spreadsheet documents in dot net core. Works in dotnet core for multiple platforms including Azure with no extra dependencies or need to install MS Office or Interop.

Open & Save Multiple File Formats

IronXL allows .NET engineers to write and export Excel Spreadsheets from dotnet Core APPs. Open and Edit XLS/XLSX/CSV/TSV - Save and Export to XLS/XLSX/CSV/TSV/JSON. IronXL out performs free and Interop libraries at parsing, altering, and saving Excel documents.

SQL Support Out-of-the-box

Transfer Data between Excel, SQL and GridViews by opening spreadsheets as System.Data.DataSet and System.Data.DataTable objects.

Modify Excel Data

Edit Microsoft Excel formulas - recalculate every time a work sheet it changed. Quick and Easy WorkSheet [“A1:B10”] formatting. Merge and set Ranges, Columns and Rows.

Style Your Excel Documents

Set Font, Size, Background, Border, Alignment and Number format.
C# Create Excel Spreadsheet .NET Core Library - for Excel document Creation and Editing.

Easy to Build with Visual Studio for .NET Core Projects

IronXL puts Excel Tools in your own hands with intellisense support. Install with NuGet for Visual Studio or a manual DLL download free for .NET Core. You'll be set up in the blink of an eye.

Supports:

  • .NET Core 2.0 and above
  • .NET Framework 4.0 and above support C#, VB, F#
  • Microsoft Visual Studio. .NET Development IDE Icon
  • NuGet Installer Support for Visual Studio
  • JetBrains ReSharper C# language assistant compatible
  • Microsoft Azure C# .NET  hosting platform compatible

Licensing & Pricing for .NET Core

Free for development. Licenses from $999.

View Full License Options

Excel Spreadsheet Tutorials for .NET Core

How to Create Excel Files in C#
C#ExcelASP.NET
Jonas Schmidt - C# Developer

How to Create Excel Files in .NET Core

See How Jonas uses IronXL to generate Excel Files without using Office Interop...

View Jonas' Excel File Generation Tutorial
Reading and Writing Excel Tutorial + Code Examples in C# & VB.NET
C#ExcelXLS
Elijah Williams - Product Development Engineer

Open and Edit Excel Files in C# or VB.NET

Elijah shares a no-nonsense approach to reading Excel data into C# Applications...

See Elijah's Excel Reading & Editing Tutorial
Tutorial + Code Examples VB.NET PDF Creation and Editing | VB.NET & ASP.NET PDF
C#ExcelData
Rebecca White - .NET Solution Director

How to Read Excel Files into .NET Apps.

Rebecca's code walkthrough for reading Excel data into a .NET application...

Read Becky's C# Tutorial

.NET Core Engineers use IronXL for...

Accounting and Finance Systems

  • # Receipts
  • # Reporting
  • # Invoice Printing
Add Excel Support to ASP.NET Accounting and Finance Systems

Business Digitization

  • # Documentation
  • # Ordering & Labelling
  • # Paper Replacement
.NET Core Business Digitization Use Cases

Enterprise Content Management

  • # Content Production
  • # Document Management
  • # Content Distribution
.NET CMS Excel Support

Data and Reporting Applications

  • # Performance Tracking
  • # Trend Mapping
  • # Reports
.NET Core Excel Reports
Download Today
Iron Software Enterprise .NET Component Developers
C# Library Developers

Thousands of corporations, governments, SMEs and developers alike trust Iron software products.

Iron's team have over 10 years experience in the .NET software component market.

Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon
Iron Customer Icon

Ready to Get Started?

Nuget Downloads 2,237,574Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required