IRONSOFTWAREHOME

How to Read Excel Files in C# Without Interop: Complete Developer Guide

Jacob Mellor, Chief Technology Officer @ Team Iron
Jacob Mellor
Updated: August 2, 2026

The first time I had to read an Excel file from a .NET service, I reached for Microsoft Interop and regretted it almost immediately. It needed Office installed on the server, it leaked processes when an exception was thrown mid-method, and it fell over under any kind of load. We built IronXL because we kept running into those exact walls. This guide is how I actually read XLS and XLSX in production today, including the gotchas that bite people most.

Most of what follows is direct file-format reading, no Excel application involved: load a workbook, pull values out by cell address, validate ranges, push the data into a database or an API. The library handles XLS and XLSX without needing Microsoft Office on the machine.

Quickstart: Read a Cell with IronXL in One Line

A single line loads an Excel workbook and pulls a value out of a cell. No Interop, no setup, no Excel process running in the background.

  1. 1Install IronXL with NuGet Package Manager

    PM > Install-Package IronXL.Excel

  2. 2Copy and run this code snippet.

    var value = IronXL.WorkBook.Load("file.xlsx").WorkSheets[0]["A1"].StringValue;
    C#
  3. 3Deploy to test on your live environment

    Start using IronXL in your project today with a free trial
    arrow pointer

How Do I Set Up IronXL to Read Excel Files in C#?

The setup itself is a NuGet install and a using IronXL; directive. The library handles both .XLS and .XLSX, so the same code path works for legacy spreadsheets and the modern Open XML format.

Follow these steps to get started:

  1. Download the C# Library to read Excel files
  2. Load and read Excel workbooks using WorkBook.Load()
  3. Access worksheets with the GetWorkSheet() method
  4. Read cell values using Excel-style addresses like sheet["A1"].Value
  5. Validate and process spreadsheet data programmatically
  6. Export data to databases using Entity Framework

IronXL reads and edits Microsoft Excel documents from C# without depending on the Office product. It does not require Microsoft Excel installed, and it does not need Interop. See the comparison with Microsoft.Office.Interop.Excel for the differences in approach and API surface.

If you are coming from Interop, the mental model is different and worth getting straight before you write any code. Interop launches a real Excel.exe process behind the scenes and your code automates that application across COM. IronXL reads the file bytes directly into memory and presents them as objects. No Excel process, no message pump, no COM marshaling. The practical consequence I see trip people up most: Interop indexes cells from [1, 1] (1-based, just like Excel's UI), but IronXL row/column access is 0-based. The ["A1"] string indexer matches the spreadsheet UI in both libraries, so when you can stay in the string form, the migration reads almost identically. The afternoon-long off-by-one bugs all come from the numeric indexer.

IronXL Includes:

  • Dedicated product support from our .NET engineers
  • Easy installation via Microsoft Visual Studio
  • Free trial test for development. Licenses from liteLicense

Both C# and VB.NET projects can use IronXL the same way to read or create Excel files.

Reading .XLS and .XLSX Excel Files Using IronXL

Here's the essential workflow for reading Excel files using IronXL:

  1. Install the IronXL Excel Library via NuGet package or download the .NET Excel DLL
  2. Use the WorkBook.Load() method to read any XLS, XLSX, or CSV document
  3. Access cell values using Excel-style addresses: sheet["A11"].DecimalValue
using IronXL;
using System;
using System.Linq;

// Load Excel workbook from file path
WorkBook workBook = WorkBook.Load("test.xlsx");

// Access the first worksheet using LINQ
WorkSheet workSheet = workBook.WorkSheets.First();

// Read integer value from cell A2
int cellValue = workSheet["A2"].IntValue;
Console.WriteLine($"Cell A2 value: {cellValue}");

// Iterate through a range of cells
foreach (var cell in workSheet["A2:A10"])
{
    Console.WriteLine("Cell {0} has value '{1}'", cell.AddressString, cell.Text);
}

// Advanced Operations with LINQ
// Calculate sum using built_in Sum() method
decimal sum = workSheet["A2:A10"].Sum();

// Find maximum value using LINQ
decimal max = workSheet["A2:A10"].Max(c => c.DecimalValue);

// Output calculated results
Console.WriteLine($"Sum of A2:A10: {sum}");
Console.WriteLine($"Maximum value: {max}");

The snippet walks through the four operations you will use constantly: loading a workbook, reading a cell by address, iterating a range, and running calculations against a range. WorkBook.Load() detects the file format from the extension, and the range syntax ["A2:A10"] matches the cell selection you would type into Excel itself. Ranges are IEnumerable<Cell>, so LINQ works directly against them for sums, filters, and projections.

How fast is this in practice?

To give you a feel for realistic performance, I wrote a small console project that loads the same kind of files used throughout this tutorial and times the operations. The harness lives in a ReadExcelBenchmark sample project you can run yourself, so you can measure these timings on your own hardware rather than trusting a number from mine. The relative pattern across multiple runs is consistent:

OperationFirst cold load (fresh process)Warm average over 10 iterations
Load GDP.xlsx (213 rows) and sum column BSlowest run, dominated by startupDrops sharply, then holds steady
Load People.xlsx (100 rows) and regex-validate every cellFast even coldComparable to its cold run

The first cold load is dominated by IronXL's assembly load and JIT warm-up; the second cold run is much lower because the assembly is already in memory by then. Warm runs settle into a tight band once the JIT has compiled the hot paths.

If you are seeing multi-second loads on files of this size, the culprit is almost always calling WorkBook.Load() inside a loop instead of once outside it. Load the workbook once, then iterate the cells or rows you actually need. I see that exact pattern in about half the "IronXL is slow" support tickets we get.

The code examples in this tutorial work with three sample Excel spreadsheets that showcase different data scenarios:

Three Excel spreadsheet files displayed in Visual Studio Solution Explorer Sample Excel files (GDP.xlsx, People.xlsx, and PopulationByState.xlsx) used throughout this tutorial for demonstrating various IronXL operations.


How Can I Install the IronXL C# Library?


Add the IronXL.Excel library to a .NET project through NuGet, or by referencing the DLL directly.

Installing the IronXL NuGet Package

  1. In Visual Studio, right-click on your project and select "Manage NuGet Packages..."
  2. Search for IronXL.Excel in the Browse tab
  3. Click the Install button to add IronXL to your project

NuGet Package Manager interface showing IronXL.Excel package installation Installing IronXL through Visual Studio's NuGet Package Manager provides automatic dependency management.

Alternatively, install IronXL using the Package Manager Console:

  1. Open the Package Manager Console (Tools → NuGet Package Manager → Package Manager Console)
  2. Run the installation command:

PM > Install-Package IronXL.Excel

You can also view the package details on the NuGet website.

Manual Installation

For manual installation, download the IronXL .NET Excel DLL and reference it directly in your Visual Studio project.

How Do I Load and Read an Excel Workbook?

The WorkBook class represents an entire Excel file. Load Excel files using the WorkBook.Load() method, which accepts file paths for XLS, XLSX, CSV, and TSV formats.

using IronXL;
using System;
using System.Linq;

// Load Excel file from specified path
WorkBook workBook = WorkBook.Load(@"Spreadsheets\GDP.xlsx");

Console.WriteLine("Workbook loaded successfully.");

// Access specific worksheet by name
WorkSheet sheet = workBook.GetWorkSheet("Sheet1");

// Read and display cell value
string cellValue = sheet["A1"].StringValue;
Console.WriteLine($"Cell A1 contains: {cellValue}");

// Perform additional operations
// Count non_empty cells in column A
int rowCount = sheet["A:A"].Count(cell => !cell.IsEmpty);
Console.WriteLine($"Column A has {rowCount} non_empty cells");

Each WorkBook contains multiple WorkSheet objects representing individual Excel sheets. Access worksheets by name using GetWorkSheet():

using IronXL;
using System;

// Get worksheet by name
WorkSheet workSheet = workBook.GetWorkSheet("GDPByCountry");

Console.WriteLine("Worksheet 'GDPByCountry' not found");
// List available worksheets
foreach (var sheet in workBook.WorkSheets)
{
    Console.WriteLine($"Available: {sheet.Name}");
}

How Do I Create New Excel Documents in C#?

Create new Excel documents by constructing a WorkBook object with your desired file format. IronXL supports both modern XLSX and legacy XLS formats.

using IronXL;

// Create new XLSX workbook (recommended format)
WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLSX);

// Set workbook metadata
workBook.Metadata.Author = "Your Application";
workBook.Metadata.Comments = "Generated by IronXL";

// Create new XLS workbook for legacy support
WorkBook legacyWorkBook = WorkBook.Create(ExcelFileFormat.XLS);

// Save the workbook
workBook.SaveAs("NewDocument.xlsx");

Note: Use ExcelFileFormat.XLS only when compatibility with Excel 2003 and earlier is required.

How Can I Add Worksheets to an Excel Document?

An IronXL WorkBook contains a collection of worksheets. Understanding this structure helps when building multi-sheet Excel files.

Diagram showing WorkBook containing multiple WorkSheets Visual representation of the WorkBook structure containing multiple WorkSheet objects in IronXL.

Create new worksheets using CreateWorkSheet():

using IronXL;

// Create multiple worksheets with descriptive names
WorkSheet summarySheet = workBook.CreateWorkSheet("Summary");
WorkSheet dataSheet = workBook.CreateWorkSheet("RawData");
WorkSheet chartSheet = workBook.CreateWorkSheet("Charts");

// Set the active worksheet
workBook.SetActiveTab(0); // Makes "Summary" the active sheet

// Access default worksheet (first sheet)
WorkSheet defaultSheet = workBook.DefaultWorkSheet;

How Do I Read and Edit Cell Values?

Read and Edit a Single Cell

Access individual cells through the worksheet's indexer property. IronXL's Cell class provides strongly-typed value properties.

using IronXL;
using System;
using System.Linq;

// Load workbook and get worksheet
WorkBook workBook = WorkBook.Load("test.xlsx");
WorkSheet workSheet = workBook.DefaultWorkSheet;

// Access cell B1
IronXL.Cell cell = workSheet["B1"].First();

// Read cell value with type safety
string textValue = cell.StringValue;
int intValue = cell.IntValue;
decimal decimalValue = cell.DecimalValue;
DateTime? dateValue = cell.DateTimeValue;

// Check cell data type
if (cell.IsNumeric)
{
    Console.WriteLine($"Numeric value: {cell.DecimalValue}");
}
else if (cell.IsText)
{
    Console.WriteLine($"Text value: {cell.StringValue}");
}

The Cell class offers multiple properties for different data types, automatically converting values when possible. For more cell operations, see the Cell formatting tutorial.

// Write different data types to cells
workSheet["A1"].Value = "Product Name";     // String
workSheet["B1"].Value = 99.95m;             // Decimal
workSheet["C1"].Value = DateTime.Today;     // Date
workSheet["D1"].Formula = "=B1*1.2";        // Formula
                                            // Format cells
workSheet["B1"].FormatString = "$#,##0.00"; // Currency format
workSheet["C1"].FormatString = "yyyy-MM-dd";// Date format
                                            // Save changes
workBook.Save();

How Can I Work with Cell Ranges?

The Range class represents a collection of cells, enabling bulk operations on Excel data.

using IronXL;
using Range = IronXL.Range;

// Select range using Excel notation
Range range = workSheet["D2:D101"];

// Alternative: Use Range class for dynamic selection
Range dynamicRange = workSheet.GetRange("D2:D101"); // Row 2_101, Column D

// Perform bulk operations
range.Value = 0; // Set all cells to 0

Process ranges efficiently using loops when cell count is known:

// Data validation example
public class ValidationResult
{
    public int Row { get; set; }
    public string PhoneError { get; set; }
    public string EmailError { get; set; }
    public string DateError { get; set; }
    public bool IsValid => string.IsNullOrEmpty(PhoneError) && 
                           string.IsNullOrEmpty(EmailError) && 
                           string.IsNullOrEmpty(DateError);
}

// Validate data in rows 2-101
var results = new List<ValidationResult>();

for (int row = 2; row <= 101; row++)
{
    var result = new ValidationResult { Row = row };
    
    // Get row data efficiently
    var phoneCell = workSheet[$"B{row}"];
    var emailCell = workSheet[$"D{row}"];
    var dateCell = workSheet[$"E{row}"];
    
    // Validate phone number
    if (!IsValidPhoneNumber(phoneCell.StringValue))
        result.PhoneError = "Invalid phone format";
    
    // Validate email
    if (!IsValidEmail(emailCell.StringValue))
        result.EmailError = "Invalid email format";
    
    // Validate date
    if (!dateCell.IsDateTime)
        result.DateError = "Invalid date format";
    
    results.Add(result);
}

// Helper methods
bool IsValidPhoneNumber(string phone) => 
    System.Text.RegularExpressions.Regex.IsMatch(phone, @"^\d{3}-\d{3}-\d{4}$");

bool IsValidEmail(string email) => 
    email.Contains("@") && email.Contains(".");

How Do I Add Formulas to Excel Spreadsheets?

Apply Excel formulas using the Formula property. IronXL supports standard Excel formula syntax.

using IronXL;

// Add formulas to calculate percentages
int lastRow = 50;
for (int row = 2; row < lastRow; row++)
{
    // Calculate percentage: current value / total
    workSheet[$"C{row}"].Formula = $"=B{row}/B{lastRow}";
    // Format as percentage
    workSheet[$"C{row}"].FormatString = "0.00%";
}
// Add summary formulas
workSheet["B52"].Formula = "=SUM(B2:B50)";      // Sum
workSheet["B53"].Formula = "=AVERAGE(B2:B50)";   // Average
workSheet["B54"].Formula = "=MAX(B2:B50)";       // Maximum
workSheet["B55"].Formula = "=MIN(B2:B50)";       // Minimum
                                                 // Force formula evaluation
workBook.EvaluateAll();

To edit existing formulas, explore the Excel formulas tutorial.

How Can I Validate Spreadsheet Data?

A common use case I see is validating user-supplied spreadsheets before pulling the data into a database. The example below checks phone numbers, emails, and dates with regular expressions and IronXL's built-in type checks.

using System.Text.RegularExpressions;
using IronXL;

// Validation implementation
for (int i = 2; i <= 101; i++)
{
    var result = new PersonValidationResult { Row = i };
    results.Add(result);
    
    // Get cells for current person
    var cells = workSheet[$"A{i}:E{i}"].ToList();
    
    // Validate phone (column B)
    string phone = cells[1].StringValue;
    if (!Regex.IsMatch(phone, @"^\+?1?\d{10,14}$"))
    {
        result.PhoneNumberErrorMessage = "Invalid phone format";
    }
    
    // Validate email (column D)
    string email = cells[3].StringValue;
    if (!Regex.IsMatch(email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$"))
    {
        result.EmailErrorMessage = "Invalid email address";
    }
    
    // Validate date (column E)
    if (!cells[4].IsDateTime)
    {
        result.DateErrorMessage = "Invalid date format";
    }
}

Save validation results to a new worksheet:

// Create results worksheet
var resultsSheet = workBook.CreateWorkSheet("ValidationResults");

// Add headers
resultsSheet["A1"].Value = "Row";
resultsSheet["B1"].Value = "Valid";
resultsSheet["C1"].Value = "Phone Error";
resultsSheet["D1"].Value = "Email Error";
resultsSheet["E1"].Value = "Date Error";

// Style headers
resultsSheet["A1:E1"].Style.Font.Bold = true;
resultsSheet["A1:E1"].Style.SetBackgroundColor("#4472C4");
resultsSheet["A1:E1"].Style.Font.Color = "#FFFFFF";

// Output validation results
for (int i = 0; i < results.Count; i++)
{
    var result = results[i];
    int outputRow = i + 2;
    
    resultsSheet[$"A{outputRow}"].Value = result.Row;
    resultsSheet[$"B{outputRow}"].Value = result.IsValid ? "Yes" : "No";
    resultsSheet[$"C{outputRow}"].Value = result.PhoneNumberErrorMessage ?? "";
    resultsSheet[$"D{outputRow}"].Value = result.EmailErrorMessage ?? "";
    resultsSheet[$"E{outputRow}"].Value = result.DateErrorMessage ?? "";
    
    // Highlight invalid rows
    if (!result.IsValid)
    {
        resultsSheet[$"A{outputRow}:E{outputRow}"].Style.SetBackgroundColor("#FFE6E6");
    }
}

// Auto-fit columns
for (int col = 0; col < 5; col++)
{
    resultsSheet.AutoSizeColumn(col);
}

// Save validated workbook
workBook.SaveAs(@"Spreadsheets\PeopleValidated.xlsx");

How Do I Export Excel Data to a Database?

Use IronXL with Entity Framework to export spreadsheet data directly to databases. This example demonstrates exporting country GDP data to SQLite.

using System;
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
using IronXL;

// Define entity model
public class Country
{
    [Key]
    public Guid Id { get; set; } = Guid.NewGuid();
    
    [Required]
    [MaxLength(100)]
    public string Name { get; set; }
    
    [Range(0, double.MaxValue)]
    public decimal GDP { get; set; }
    
    public DateTime ImportedDate { get; set; } = DateTime.UtcNow;
}

Configure Entity Framework context for database operations:

public class CountryContext : DbContext
{
    public DbSet<Country> Countries { get; set; }
    
    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        // Configure SQLite connection
        optionsBuilder.UseSqlite("Data Source=CountryGDP.db");
        
        // Enable sensitive data logging in development
        #if DEBUG
        optionsBuilder.EnableSensitiveDataLogging();
        #endif
    }
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        // Configure decimal precision
        modelBuilder.Entity<Country>()
            .Property(c => c.GDP)
            .HasPrecision(18, 2);
    }
}
Please note: Note: To use different databases, install the appropriate NuGet package (e.g., Microsoft.EntityFrameworkCore.SqlServer for SQL Server) and modify the connection configuration accordingly.

Import Excel data to database:

using System.Threading.Tasks;
using IronXL;
using Microsoft.EntityFrameworkCore;

public async Task ImportGDPDataAsync()
{
    try
    {
        // Load Excel file
        var workBook = WorkBook.Load(@"Spreadsheets\GDP.xlsx");
        var workSheet = workBook.GetWorkSheet("GDPByCountry");
        
        using (var context = new CountryContext())
        {
            // Ensure database exists
            await context.Database.EnsureCreatedAsync();
            
            // Clear existing data (optional)
            await context.Database.ExecuteSqlRawAsync("DELETE FROM Countries");
            
            // Import data with progress tracking
            int totalRows = 213;
            for (int row = 2; row <= totalRows; row++)
            {
                // Read country data
                var countryName = workSheet[$"A{row}"].StringValue;
                var gdpValue = workSheet[$"B{row}"].DecimalValue;
                
                // Skip empty rows
                if (string.IsNullOrWhiteSpace(countryName))
                    continue;
                
                // Create and add entity
                var country = new Country
                {
                    Name = countryName.Trim(),
                    GDP = gdpValue * 1_000_000 // Convert to actual value if in millions
                };
                
                await context.Countries.AddAsync(country);
                
                // Save in batches for performance
                if (row % 50 == 0)
                {
                    await context.SaveChangesAsync();
                    Console.WriteLine($"Imported {row - 1} of {totalRows} countries");
                }
            }
            
            // Save remaining records
            await context.SaveChangesAsync();
            Console.WriteLine($"Successfully imported {await context.Countries.CountAsync()} countries");
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine($"Import failed: {ex.Message}");
        throw;
    }
}

How Can I Import API Data into Excel Spreadsheets?

Combine IronXL with HTTP clients to populate spreadsheets with live API data. This example uses RestClient.Net to fetch country data.

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
using IronXL;

// Define data model matching API response
public class RestCountry
{
    public string Name { get; set; }
    public long Population { get; set; }
    public string Region { get; set; }
    public string NumericCode { get; set; }
    public List<Language> Languages { get; set; }
}

public class Language
{
    public string Name { get; set; }
    public string NativeName { get; set; }
}

// Fetch and process API data
public async Task ImportCountryDataAsync()
{
    using var httpClient = new HttpClient();
    
    try
    {
        // Call REST API
        var response = await httpClient.GetStringAsync("https://restcountries.com/v3.1/all");
        var countries = JsonConvert.DeserializeObject<List<RestCountry>>(response);
        
        // Create new workbook
        var workBook = WorkBook.Create(ExcelFileFormat.XLSX);
        var workSheet = workBook.CreateWorkSheet("Countries");
        
        // Add headers with styling
        string[] headers = { "Country", "Population", "Region", "Code", "Language 1", "Language 2", "Language 3" };
        for (int col = 0; col < headers.Length; col++)
        {
            var headerCell = workSheet[0, col];
            headerCell.Value = headers[col];
            headerCell.Style.Font.Bold = true;
            headerCell.Style.SetBackgroundColor("#366092");
            headerCell.Style.Font.Color = "#FFFFFF";
        }
        
        // Import country data
        await ProcessCountryData(countries, workSheet);
        
        // Save workbook
        workBook.SaveAs("CountriesFromAPI.xlsx");
    }
    catch (Exception ex)
    {
        Console.WriteLine($"API import failed: {ex.Message}");
    }
}

The API returns JSON data in this format:

JSON response structure showing country data with nested language arrays Sample JSON response from the REST Countries API showing hierarchical country information.

Process and write the API data to Excel:

private async Task ProcessCountryData(List<RestCountry> countries, WorkSheet workSheet)
{
    for (int i = 0; i < countries.Count; i++)
    {
        var country = countries[i];
        int row = i + 1; // Start from row 1 (after headers)
        
        // Write basic country data
        workSheet[$"A{row}"].Value = country.Name;
        workSheet[$"B{row}"].Value = country.Population;
        workSheet[$"C{row}"].Value = country.Region;
        workSheet[$"D{row}"].Value = country.NumericCode;
        
        // Format population with thousands separator
        workSheet[$"B{row}"].FormatString = "#,##0";
        
        // Add up to 3 languages
        for (int langIndex = 0; langIndex < Math.Min(3, country.Languages?.Count ?? 0); langIndex++)
        {
            var language = country.Languages[langIndex];
            string columnLetter = ((char)('E' + langIndex)).ToString();
            workSheet[$"{columnLetter}{row}"].Value = language.Name;
        }
        
        // Add conditional formatting for regions
        if (country.Region == "Europe")
        {
            workSheet[$"C{row}"].Style.SetBackgroundColor("#E6F3FF");
        }
        else if (country.Region == "Asia")
        {
            workSheet[$"C{row}"].Style.SetBackgroundColor("#FFF2E6");
        }
        
        // Show progress every 50 countries
        if (i % 50 == 0)
        {
            Console.WriteLine($"Processed {i} of {countries.Count} countries");
        }
    }
    
    // Auto-size all columns
    for (int col = 0; col < 7; col++)
    {
        workSheet.AutoSizeColumn(col);
    }
}

Common Gotchas

A few things bite people often enough that they deserve their own section.

Empty cells return 0, not null

This one bit me early on. Calling sheet["A1"].IntValue (or DecimalValue, or DoubleValue) on a blank cell returns 0, not null. If you are summing or averaging a column with gaps in it, the blanks silently become zeros and skew the result. I now guard reads on any sheet where missing values are possible:

var cell = sheet["B5"];
if (!cell.IsEmpty)
{
    total += cell.DecimalValue;
}

Cell.IsEmpty is cheap, so I default to using it whenever the spreadsheet is user-supplied rather than machine-generated.

Dates come back as serial numbers if you ask for the wrong type

Excel stores dates as serial numbers under the hood (45292 means 2024-01-01, for example). The most common date-handling question in our support inbox is "why is my date showing up as 45292?" The answer is almost always that the cell was read as StringValue or IntValue instead of DateTimeValue:

// What you probably want:
DateTime birthday = sheet["E2"].DateTimeValue;

// What gives you "45292":
string birthday = sheet["E2"].StringValue;

Cell.IsDateTime will tell you whether the cell was authored as a date in the first place, which is useful for validation pipelines where the input format is not guaranteed.

Cell index numerics are 0-based, but A1 strings are 1-based

Covered above in the Interop migration paragraph, but worth restating because it catches even people who have never been near COM. sheet[0, 0] is the same cell as sheet["A1"]. Mixing the two styles in the same loop is how off-by-one bugs creep in. I pick one shape per file and stick with it; the ["A1"] string form is what I default to because it matches what you see in the spreadsheet itself.

Sample project for the benchmark numbers

If you want to reproduce the timing numbers from earlier, the harness is a small .NET 9 console app:

// ReadExcelBenchmark/Program.cs (excerpt)
IronXL.License.LicenseKey = Environment.GetEnvironmentVariable("IRONXL_LICENSE_KEY");

var sw = Stopwatch.StartNew();
var workbook = WorkBook.Load("GDP.xlsx");
decimal sum = workbook.WorkSheets.First()["B2:B214"].Sum();
sw.Stop();
Console.WriteLine($"cold: {sw.Elapsed.TotalMilliseconds:F1} ms");

Run it under dotnet run -c Release, generate the two sample workbooks on first launch, and you can substitute your own files to see how the numbers move with file size and complexity.


Object Reference and Resources

The IronXL API Reference covers every class and method, including the ones this tutorial does not touch.

Additional tutorials for Excel operations:

Summary

IronXL.Excel reads and manipulates Excel files across XLS, XLSX, CSV, and TSV formats. It runs without Microsoft Excel or Interop on the host machine.

For cloud-based spreadsheet manipulation, you might also explore the Google Sheets API Client Library for .NET, which complements IronXL's local file capabilities.

Ready to implement Excel automation in your C# projects? Download IronXL or explore licensing options for production use.

Frequently Asked Questions

What is IronXL and why should I use it for reading Excel files in C#?

IronXL is a C# library designed to read and manipulate Excel files without needing Microsoft Office or Interop. It offers a simple API for accessing spreadsheet data directly, making it ideal for situations where server-side or automated Excel processing is required.

How do I install IronXL in my C# project?

You can install IronXL via NuGet by searching for 'IronXL.Excel' in the Visual Studio NuGet Package Manager and clicking install. Alternatively, you can download the DLL from the IronXL website and reference it directly in your project.

What are the benefits of using IronXL over Microsoft Interop for Excel file handling?

IronXL does not require Microsoft Office to be installed, avoids running background Excel processes, and is more stable under heavy load compared to Microsoft Interop. It also uses a direct file reading approach, which can be more efficient and less error-prone.

Can I use IronXL to edit as well as read Excel files?

Yes, IronXL allows both reading and writing of Excel files. You can read cell values, modify them, add new worksheets, and save changes to existing files or create new ones in XLSX or XLS formats.

How do I read a specific cell value from an Excel file using IronXL?

You can read a cell's value by loading the workbook with `WorkBook.Load()`, accessing the desired worksheet, and then retrieving the cell value using the cell address, like `sheet["A1"].StringValue`.

What types of Excel files can IronXL handle?

IronXL can read and write XLS, XLSX, CSV, and TSV files. It automatically detects the file format from the extension when loading the file.

Does IronXL support formula evaluation in Excel files?

Yes, IronXL supports Excel formulas. You can add formulas to cells, and use the `WorkBook.EvaluateAll()` method to ensure they are calculated correctly before saving the file.

How can I export data from an Excel file to a database using IronXL?

You can use IronXL in conjunction with Entity Framework to export Excel data directly into a database. Load the Excel file, iterate through the required cells, and save the data entities using Entity Framework's ORM capabilities.

Is it possible to validate Excel data with IronXL before importing it into a database?

Yes, you can validate spreadsheet data by using IronXL to iterate over the cell values, check for expected formats or values, and log any discrepancies before executing a database import.

Can IronXL be used in both C# and VB.NET projects?

Yes, IronXL can be utilized in both C# and VB.NET projects without any difference in functionality, allowing for seamless Excel file operations across these .NET languages.

Jacob Mellor, Chief Technology Officer @ Team Iron
Chief Technology Officer

Jacob Mellor is Chief Technology Officer at Iron Software and a visionary engineer pioneering C# PDF technology. As the original developer behind Iron Software's core codebase, he has shaped the company's product architecture since its inception, transforming it alongside CEO Cameron Rimington into a 50+ person company serving NASA, Tesla, and global government agencies.

...
Read More

Ready to Get Started?

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

Get your FREE

30-day Trial Key instantly.

bullet_checkedNo credit card or account creation required
bullet_testTest in production
without watermarks
bullet_calendar30 days fully
functional product
bullet_support24/5 technical
support during trial
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronXL.Excel
nuget.org/packages/IronXL.Excel/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronXL"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

  1. Download and unzip IronXL to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronXL.dll"

Licenses from $999

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