Open Source C Library for Excel Spreadsheets

Create, Edit, Manipulate, and Convert Microsoft Excel 2007 and XLSX Spreadsheet files, merging spreadsheets, adding charts to worksheet via Open Source C API.

Libxlsxwriter is an open source C library that can be used to work with Microsoft Excel 2007 as well as Excel XLSX file inside your own applications. The Libxlsxwriter library is compatible with Excel XLSX files and allows developers to create, modify, and process XLSX spreadsheets with ease. The library working smoothly on leading platforms like Linux, FreeBSD, OpenBSD, OS X, iOS, and Windows. It can compile for 32 as well as for 64 bit.

The open source Libxlsxwriter library is well optimized and can properly work with large spreadsheet files. It supports several important features, such as Merging spreadsheet cells, defined names, Autofilters support, adding Charts to worksheet page, data validation and drop-down lists, adding PNG/JPEG images, adding cell comments, working with VBA macros, add or remove the column from a sheet, and many more.

Previous Next

Getting Started with Libxlsxwriter

Libxlsxwriter supports CMake for building and installing the library. Please use the following command.

Install libxlsxwriter via CRAN


Clone the libxlsxwriter source code repository from GitHub. Please use the following code.

Install libxlsxwriter via GitHub

it clone
# Or use your preferred protocol instead of https 

C API to Create Excel XLSX Spreadsheet

The open source Libxlsxwriter API enables software developers to create and modify Excel XLSX Spreadsheets inside their C applications. The API provides supports for writing text, numbers, formulas, and hyperlinks to multiple worksheets in an Excel spreadsheet file. You can easily import or export data from Excel files and can merge or split sheets, search data, and much more.

Working with Excel Charts

The Libxlsxwriter API has provided functionality for adding and modifying Charts to Excel spreadsheets using C commands. You can use chart marker functions to generate and manage charts. You can also add a trendline to indicate trends in the data and error bars to indicate error bounds in the data. You can also data labels to a chart series to indicate the values of the plotted data points. You can easily apply chart formatting properties to any chart object.

Work with Excel Data Validation

Data validation is an Excel feature that lets developers control what users enter into an Excel cell. For example, you can restrict users to enter a number between 1 and 6 or making sure the text entry in a cell is less than 25 characters. The Libxlsxwriter API provides numerous options to validate user input such as Any Value, Whole Number, Decimal, List, Date, Time, Text length, or custom formula.

Working with VBA Macros

The Libxlsxwriter API gives software developers the ease to add a VBA file containing functions or macros to an XLSX workbook. Excel files that contain functions and macros should use an XLSM extension or else Excel will complain and possibly not open the file. The VBA macros normally refer to workbook and worksheet objects. If the VBA codenames aren't specified explicitly then libxlsxwriter will use the Excel defaults of ThisWorkbook and Sheet1, Sheet2, etc.