Recursos e visão geral técnica

EPPlus, o motor .NET para livros de exercícios Excel

Criar, ler, modificar e calcular livros de exercícios Excel em código .NET 100% gerenciado. Importar e exportar dados em vários formatos. Não é necessário Microsoft Excel.

// EPPlus 8: set the license once at startup
ExcelPackage.License.SetNonCommercialPersonal("Your name");

using var package = new ExcelPackage();
var sheet = package.Workbook.Worksheets.Add("Sales");

sheet.Cells["A1"].LoadFromCollection(
    orders, true, TableStyles.Medium2);
sheet.Cells["F2"].Formula = "SUM(D2:D100)";
package.Workbook.Calculate();

package.SaveAs("sales.xlsx");
478
Funções do Excel no mecanismo de cálculo embutido
760.000
Células escritas por segundo
Como medimos
74
Países com clientes EPPlus
17
Anos de desenvolvimento ativo, open source desde 2009 e comercial desde 2020

Recursos suportados

EPPlus é uma biblioteca .NET Framework/.NET Core para gerenciar planilhas Office Open XML , distribuídas via Nuget . Veja nossa página de Projeto Básico de Software para frameworks .NET suportados. EPPlus é totalmente escrito em código gerenciado e não depende de nenhuma outra biblioteca, como o Microsoft Excel.

A biblioteca foi projetada pensando no desenvolvedor. Nosso objetivo sempre foi que um desenvolvedor com conhecimento de Excel ou qualquer outra biblioteca de planilhas se atualize facilmente com a API. Ou – como alguém disse – inteligência para a vitória!

Worksheets & ranges

Rows, columns and cells, and everything you do with them.

Mostrar todas as característicasMostrar menos
  • Add, remove, reorder, rename and hide worksheets
  • Print areas, page breaks, document and printer settings
  • Headers and footers
  • Worksheet properties such as gridlines and tab colors
  • Sort top to bottom or left to right, with custom lists, and the sort state is updated
  • FillNumber, FillDateTime and FillList
  • Copy styles only, or exclude cell properties when copying
  • Row and column access via EntireRow and EntireColumn
  • Named ranges
  • Hyperlinks
  • Notes with rich text, and threaded comments with mentions and resolve/re-open
  • Query cells and ranges with LINQ
  • Validation types: integer, decimal, list, date, time, any and custom
Leia o guia: Worksheets & ranges

Formula calculation

A built-in calculation engine, with no dependency on Excel or any other library.

  • 478 Excel functions
  • Dynamic array formulas and LAMBDA
  • Calculate a workbook, a worksheet or a single range
  • Add your own functions at runtime
Mostrar todas as característicasMostrar menos
  • Legacy array formulas
  • Precision as displayed: numeric values are rounded according to the number format
  • Named ranges and the R1C1 format
  • External links: update the cache of xlsx, xlsm and xltx workbooks, add references or break links
  • Calculate via the external cache, or by loading and calculating the external workbook
  • OLE and DDE links are retained (read only)
  • More about formula calculation
Leia o guia: Formula calculation

Filters & slicers

Create, read, modify, apply and delete filters on ranges and tables.

  • Value, date/time, custom, top 10 and dynamic filters
  • Table and pivot table slicers
  • 14 built-in slicer styles
  • Custom slicer styles, from scratch or based on a built-in style
Leia o guia: Filters & slicers

Tables & pivot tables

Formatted tables and pivot tables, including pivot table calculation.

  • 60 table styles and 84 pivot table styles, or your own custom styles
  • Total rows, sorting and filters, and adding or deleting rows and columns with shifting
  • Pivot table calculation and GETPIVOTDATA
  • Export tables to DataTable, JSON, HTML/CSS or IEnumerable<T>
Mostrar todas as característicasMostrar menos
Leia o guia: Tables & pivot tables

Charts & sparklines

Every Excel 2019 chart type, with modern styling.

Leia o guia: Charts & sparklines

Pictures, shapes & controls

Drawing objects on the worksheet and inside cells.

Mostrar todas as característicasMostrar menos
  • Add pictures from files, streams or byte arrays
  • In-cell pictures can be marked as decorative; formats png, jpg, gif, bmp, webp and ico
  • OLE objects, linked or embedded, with custom icons
Leia o guia: Pictures, shapes & controls

Styling

Cell styles, conditional formatting and themes.

Leia o guia: Styling

Import, export & formats

Move data in and out of worksheets with one line of code.

  • Import from collections, arrays, DataSets, DataReaders and text files into formatted tables
  • Export to CSV, JSON, HTML/CSS, DataTable, IEnumerable<T> or streams
  • Load and save files, streams and byte arrays, with async/await
  • External connections and query tables
Mostrar todas as característicasMostrar menos
  • Write to a web response stream without file access
  • Templates
  • Reads and writes xlsx and xlsm. The xlsx Strict format is not supported.
  • Reads xltx, crtx and thmx
  • Reads and writes txt and csv via LoadFromText and SaveToText
  • Power Query, database, OLAP, web and text connections, and pivot tables with an external connection as source
Leia o guia: Import, export & formats

Security & VBA

Protection, encryption, signatures and macros.

Mostrar todas as característicasMostrar menos
  • Open password protected workbooks
  • Standard encryption for older Office versions, Agile for Office 2010 and later
  • VBA signatures: Legacy, Agile and V3, with five hash algorithms
Leia o guia: Security & VBA

Desempenho com cadernos de exercícios grandes

Um livro de exercícios de 63 MB com 200 colunas e 100.000 linhas, onde metade das células contém inteiros e metade contém cadeias de 36 caracteres.

EPPlus 8.7.2, Intel Core i9-12900HK (14 cores, 2.5 GHz), 64 GB RAM, NVMe SSD, Windows 11, .NET 10

Veja o código-fonte do teste
26.2 s
Crie o livro de exercícios e salve-o no disco
15.7 s
Carregue a lista de exercícios do disco

Pronto para começar?

A battle-hardened codebase after many years as the world's most downloaded .NET library for spreadsheets, with quality ensured by thousands of unit tests.

The source code for EPPlus is openly available on GitHub , distributed under the Polyform Noncommercial license.

Veja esta página para recursos adicionados à biblioteca a partir da versão 5.