Edge Rewrite
Jump to content

Draft:Excelize

From Wikipedia, the free encyclopedia
  • Comment: Wikipedia cannot be used as a source. Theroadislong (talk) 09:12, 19 August 2026 (UTC)

Excelize
DeveloperOpen-source contributors
Release30 August 2016; 10 years ago (2016-08-30)[1]
Written inGo[2]
Operating systemCross-platform[3]
TypeLibrary, Spreadsheet software
LicenseBSD 3-Clause License
Websitehttps://xuri.me/excelize

Excelize is an open-source library written in Go for reading from and writing to Microsoft Excel spreadsheet files. It supports spreadsheet formats such as XLAM, XLSM, XLSX, XLTM, and XLTX.[4] It implements the Office Open XML standard (ECMA-376 and ISO/IEC 29500).[5]

History

[edit]

The first commit to the Excelize GitHub repository was made on August 30, 2016. A book about the library, Excelize 权威指南 (Excelize: The Definitive Guide), was published to cover its architecture and usage.[6]

Features

[edit]

Excelize can read and modify documents generated by Microsoft Excel 2007 and later. Its features include:

  • File processing: Creating, reading, and modifying spreadsheets without requiring Microsoft Office.[7]
  • Streaming API: A streaming API for reading and writing data in large files to reduce memory usage.
  • Workbook elements: Support for inserting charts, pivot tables, and data validation, as well as cell formatting.[8]
  • Encryption: Support for encrypting and decrypting Compound File Binary (CFB) formats. Supported algorithms include MD4, MD5, RIPEMD-160, SHA1, SHA256, SHA384, and SHA512.[9]

Security

[edit]

In July 2026, a Denial of Service (DoS) vulnerability (CVE-2026-54063) was found in Excelize versions prior to 2.11.0.[10]

The vulnerability was located in the `checkSheet` function used for parsing worksheets, which did not validate row indices against Excel's maximum row limit of 1,048,576. Specially crafted XLSX files could cause high memory allocation, leading to application crashes.[11] The issue was fixed in version 2.11.0 by adding bounds checking for worksheet structures.[10]

Example usage

[edit]

The following is a minimal code example in Go demonstrating how to generate a new Excel spreadsheet, input data into cells, and save the file:[8][12]

f := excelize.NewFile()
defer func() {
    if err := f.Close(); err != nil {
        fmt.Println(err)
    }
}()
// Create a new worksheet named "Sheet2"
index, err := f.NewSheet("Sheet2")
if err != nil {
    fmt.Println(err)
    return
}
// Set values for cells
f.SetCellValue("Sheet2", "A2", "Hello world.")
f.SetCellValue("Sheet1", "B2", 100)
// Set the active sheet for the workbook
f.SetActiveSheet(index)
// Save the spreadsheet file
if err := f.SaveAs("Book1.xlsx"); err != nil {
    fmt.Println(err)
}

See also

[edit]

References

[edit]
  1. ↑ "First GitHub commit for Excelize". github.com. 2016-08-30. Archived from the original on 2020-11-28. Retrieved 2020-11-28.
  2. ↑ "Top Go XLSX Projects". LibHunt. Retrieved 21 August 2026.
  3. ↑ "Comparison of functionality and performance of Aspose.Cells for Go via C with Excelize, Tealeg/xlsx, and Go-OLE". Aspose Documentation. Aspose. Retrieved 21 August 2026.
  4. ↑ "Open Source Go Library - Create XLSX/XLSM Spreadsheets, Add PivotTable". File Format. Retrieved 18 August 2026.
  5. ↑ Kinnari Chohan (2026-04-15). "WebDevPro #127: Excelize Makes Spreadsheet Automation in Go Feel Like a Superpower". Packt. Retrieved 2026-08-21.
  6. ↑ Excelize 权威指南 (in Chinese). ISBN 978-7115636478. Retrieved 18 August 2026.
  7. ↑ "Reading and Writing Excel Files in Go". ZetCode. 11 April 2024. Retrieved 21 August 2026.
  8. 1 2 "Working with Excel Files Using excelize in Go". Sling Academy. 27 November 2024. Retrieved 21 August 2026.
  9. ↑ "excelize package - github.com/xuri/excelize/v2 - Go Packages". pkg.go.dev. Retrieved 18 August 2026.
  10. 1 2 "CVE-2026-54063 Detail". National Vulnerability Database. NIST. 10 July 2026. Retrieved 18 August 2026.
  11. ↑ "Vulnerability Summary for the Week of July 6, 2026". Cybersecurity and Infrastructure Security Agency (CISA). 13 July 2026. Retrieved 18 August 2026.
  12. ↑ Kevin Kelche (16 March 2023). "A Guide to working with Excel files in Golang - Excelize". Kelche. Retrieved 21 August 2026.

Category:Go (programming language) Category:Free and open-source software Category:Software using the BSD license Category:Spreadsheet software