IRONSOFTWAREHOME

C# Write to Excel [Without Using Interop] Code Example Tutorial

Curtis Chau
Curtis Chau
Updated: August 2, 2026

Follow step-by-step examples of how to create, open, and save Excel files with C#, and apply basic operations like getting sum, average, count, and more. IronXL.Excel is a stand-alone .NET software library for reading a wide range of spreadsheet formats. It does not require Microsoft Excel to be installed, nor depends on Interop.

Quickstart: Create, Write & Save Excel in a Snap

Ready to generate Excel files in under a minute? This example uses IronXL to create a workbook, write a value to a cell, and save the file - all with minimal fuss and zero reliance on Interop. It's the fastest way to get started with Excel file operations in C#.

  1. 1Install IronXL with NuGet Package Manager

    PM > Install-Package IronXL.Excel

  2. 2Copy and run this code snippet.

    var workbook = IronXL.WorkBook.Create(IronXL.ExcelFileFormat.XLSX);
    workbook.CreateWorkSheet("Data")["A1"].Value = "Fast Start";
    workbook.SaveAs("quick.xlsx");
    C#
  3. 3Deploy to test on your live environment

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

Overview

Use IronXL to Open and Write Excel Files

Open, write, save, and customize Excel files with the easy-to-use IronXL C# library.

Download a sample project from GitHub or use your own, and follow the tutorial.

  1. Install the IronXL.Excel Library from NuGet or the DLL download
  2. Use the WorkBook.Load method to read any XLS, XLSX, or CSV document.
  3. Get Cell values using intuitive syntax: sheet["A11"].DecimalValue

In this tutorial, we will walk you through:

  • Installing IronXL.Excel: how to install IronXL.Excel to an existing project.
  • Basic Operations: basic operation steps with Excel to Create or Open workbook, select sheet, select cell, and save the workbook.
  • Advanced Sheet Operations: how to utilize different manipulation capabilities like adding headers or footers, mathematical operations, and other features.

Open an Excel File: Quick Code

using IronXL;

WorkBook workBook = WorkBook.Load("test.xlsx");
WorkSheet workSheet = workBook.DefaultWorkSheet;
IronXL.Range range = workSheet["A2:A8"];
decimal total = 0;

// iterate over range of cells
foreach (var cell in range)
{
    Console.WriteLine("Cell {0} has value '{1}'", cell.RowIndex, cell.Value);
    if (cell.IsNumeric)
    {
        // Get decimal value to avoid floating numbers precision issue
        total += cell.DecimalValue;
    }
}

// Check formula evaluation
if (workSheet["A11"].DecimalValue == total)
{
    Console.WriteLine("Basic Test Passed");
}

Write and Save Changes to the Excel File: Quick Code

workSheet["B1"].Value = 11.54;

// Save Changes
workBook.SaveAs("test.xlsx");

Step 1

1. Install the IronXL.Excel Library FREE


IronXL.Excel provides a flexible and powerful library for opening, reading, editing, and saving Excel files in .NET. It can be installed and used on all of the .NET project types, like Windows applications, ASP.NET MVC, and .NET Core Application.

Install the Excel Library to your Visual Studio Project with NuGet

The first step will be to install IronXL.Excel. To add the IronXL.Excel library to the project, we have two ways: NuGet Package Manager or NuGet Package Manager Console.

To add IronXL.Excel library to our project using NuGet, we can do it using a visualized interface, NuGet Package Manager:

  1. Using mouse -> right-click on project name -> Select manage NuGet Package Manage NuGet Package
  2. From the browse tab -> search for IronXL.Excel -> Install Search for IronXL
  3. And we are done Complete Installation

Install Using NuGet Package Manager Console

  1. From tools -> NuGet Package Manager -> Package Manager Console Package Manager Console
  2. Run command

PM > Install-Package IronXL.Excel

Install Package IronXL

Manually Install with the DLL

You may also choose to manually install the DLL to your project or to your global assembly cache.


How To Tutorials

2. Basic Operations: Create, Open, Save

2.1. Sample Project: HelloWorld Console Application

Create a HelloWorld Project in Visual Studio.

  1. Open Visual Studio Open Visual Studio
  2. Choose Create New Project Create New Project
  3. Choose Console App (.NET framework) Choose Console App
  4. Give the sample the name "HelloWorld" and click create Name the Project
  5. Now the console application is created Console Application Created
  6. Add IronXL.Excel to your project -> click install Add IronXL
  7. Add code to read the first cell in the first sheet from an Excel file and print it
WorkBook workBook = IronXL.WorkBook.Load($@"{Directory.GetCurrentDirectory()}\Files\CSVList.csv");
WorkSheet workSheet = workBook.WorkSheets.First();
string cell = workSheet["A1"].StringValue;
Console.WriteLine(cell);

...

Further Reading

To learn more about working with IronXL, you may wish to look at other tutorials within this section and also the examples on our homepage, which most developers find sufficient to get started.
Our API Reference contains specific references to the WorkBook class.

Frequently Asked Questions

How can I create and save an Excel file using C# without Interop?

You can use IronXL to create and save Excel files in C# without relying on Interop. Simply create a workbook using `IronXL.WorkBook.Create`, add data to a cell, and save with the `SaveAs` method. This is a fast and straightforward process.

What are the steps to quickly generate an Excel file using IronXL?

To quickly generate an Excel file using IronXL, follow these steps: Download the IronXL library, create and open a new Excel file, write data, and then save and export your Excel workbook.

Is it possible to perform advanced operations on Excel files using IronXL?

Yes, IronXL allows you to perform advanced operations on Excel files, such as adding headers, footers, and performing mathematical operations directly within worksheets.

Do I need Microsoft Excel installed to use IronXL?

No, IronXL does not require Microsoft Excel to be installed on your system. It is a standalone .NET library that handles Excel file operations independently.

How do I install the IronXL library to my project?

You can install IronXL to your project using the NuGet Package Manager or by downloading the DLL. For NuGet, search for `IronXL.Excel` in the NuGet Package Manager and install it.

Can I read and write different Excel file formats with IronXL?

Yes, IronXL supports reading and writing multiple Excel file formats including XLS, XLSX, and CSV, allowing for flexible data handling.

What is the benefit of using IronXL for Excel operations in C#?

IronXL offers an easy-to-use API for creating, reading, and writing Excel files without the need for Interop, making it efficient for handling Excel operations in C# applications.

How can I open an existing Excel file using IronXL?

You can open an existing Excel file using the `WorkBook.Load` method provided by IronXL. This supports loading files in various formats like XLS, XLSX, and CSV.

Can IronXL be used with .NET Core applications?

Yes, IronXL can be used with .NET Core applications along with other .NET project types like Windows applications and ASP.NET MVC.

What syntax does IronXL use for accessing cell values?

IronXL uses intuitive syntax for accessing cell values, such as `sheet["A1"].StringValue` to read the value of the first cell in a worksheet.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
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