LiteExcel 2.4.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package LiteExcel --version 2.4.2
                    
NuGet\Install-Package LiteExcel -Version 2.4.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LiteExcel" Version="2.4.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LiteExcel" Version="2.4.2" />
                    
Directory.Packages.props
<PackageReference Include="LiteExcel" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LiteExcel --version 2.4.2
                    
#r "nuget: LiteExcel, 2.4.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LiteExcel@2.4.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LiteExcel&version=2.4.2
                    
Install as a Cake Addin
#tool nuget:?package=LiteExcel&version=2.4.2
                    
Install as a Cake Tool

LiteExcel

NuGet NuGet Downloads CI .NET License

A lightweight, zero-dependency .NET library for reading and writing Excel xlsx/xlsm/csv files, plus legacy xls/xlsb files (xls read/write, xlsb read/write). 轻量级 xlsx/xlsm/csv 读写库(另支持 xls 读写、xlsb 读写),零第三方依赖,AOT 友好。

Version / 版本: 2.4.2

Language / 语言

Install / 安装

dotnet add package LiteExcel

Quick Start / 快速上手

using LiteExcel;

// Object-model API / 对象模型 API
var wb = Excel.Create();
wb.Worksheets["Sheet1"].SetValue("A1", "Name");
wb.Worksheets["Sheet1"].SetValue("A2", "Zhang San");
wb.SaveAs("output.xlsx");

var opened = Excel.Open("output.xlsx");
var name = opened.Worksheets[0].Cell("A2").GetString();

// Classic API / 经典 API(XlsxWriter / XlsxReader)
var sheet = new SheetData
{
    SheetName = "Sheet1",
    Headers = new() { "Name", "Age" },
    Rows = new()
    {
        new Cell[] { Cell.FromText("Zhang San"), Cell.FromNumber(25) },
    },
};
XlsxWriter.Write("output2.xlsx", sheet);
var read = XlsxReader.Read("output2.xlsx", 0);

Features / 特性

  • Zero dependencies / 零依赖
  • AOT friendly / AOT 友好
  • net48 + net8.0
  • Object-model API Excel -> Workbook -> Worksheet -> Cell/Range/Cells / 直觉化对象模型 API
  • xlsx / xlsm / csv read+write, xls read+write, xlsb read/write / 多格式支持(xlsx/xlsm/csv 读写、xls 读写、xlsb 读写)
  • Streaming read/write for large files / 大文件流式读写
  • Read/Write, styles, merged cells, auto filter, row height, comments, data validation, append, Stream, List<T>/DataTable
  • 读/写、样式、合并、自动筛选、行高、批注、数据验证、追加、Stream、List<T>/DataTable
  • File-level security: open password (Agile Encryption) + modify password (write protection) on xlsx/xlsm/xlsb, via Workbook.Security (SetOpenPassword / SetModifyPassword / RemoveOpenPassword / RemoveModifyPassword) / 文件级安全:打开密码(Agile 加密)+ 修改密码(写保护),支持 xlsx/xlsm/xlsb
  • Hyperlinks: read + write on all 4 formats (xlsx/xlsm/xlsb/xls; external URLs + internal #Sheet1!A1 jumps via Cell.Hyperlink) / 超链接:xlsx/xlsm/xlsb/xls 四格式读写(外部链接 + 内部跳转)
  • Freeze panes: FreezeRows / FreezeColumns on xlsx/xlsb/xls (arbitrary rows/columns), FreezeHeader compatible / 冻结窗格:xlsx/xlsb/xls 任意行列冻结,FreezeHeader 兼容
  • Images: write-only on xlsx/xlsm — Floating drawing + InCell richData, with anchor/move-mode/AltText (ws.AddImage, ImageAnchor, ImageMoveMode) / 图片:仅写回 xlsx/xlsm(浮动图 + 单元格内嵌,支持锚点/移动方式/AltText)

Docs / 文档

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.4.79 43 9/28/2026
2.4.78 54 9/26/2026
2.4.77 92 9/18/2026
2.4.76 91 9/15/2026
2.4.75 106 9/10/2026
2.4.74 101 9/9/2026
2.4.71 109 9/3/2026
2.4.7 111 8/27/2026
2.4.6 100 8/25/2026
2.4.5 106 8/24/2026
2.4.4 114 8/22/2026
2.4.3 93 8/22/2026
2.4.2 112 8/21/2026
2.4.1 108 8/19/2026
2.4.0 105 8/19/2026
2.3.0 123 8/18/2026
2.2.6 125 8/17/2026
2.2.5 114 8/15/2026
2.2.4 104 8/15/2026
2.2.3 109 8/15/2026
Loading failed