A C library for creating Excel XLSX files.
Find a file
2019-11-17 18:51:49 +00:00
.github Added sponsorhip details. 2019-10-30 09:12:13 +00:00
cmake Remove FindZLIB.cmake 2019-06-07 00:08:31 +01:00
cocoapods Prep for release 0.8.0. 2018-09-11 22:50:29 +01:00
dev/release Add docs and an example for add_vba_project. 2019-06-19 00:21:04 +01:00
docs Added doc section on format categories. 2019-11-17 18:02:22 +00:00
examples Made deprection of new_workbook() function explicit. 2019-11-16 20:32:37 +00:00
include Prep for release 0.8.8. 2019-11-17 18:51:49 +00:00
lib Initial commit 2014-06-08 17:40:59 +01:00
src Refactored the chart pattern struct. 2019-11-17 13:09:45 +00:00
test Made deprection of new_workbook() function explicit. 2019-11-16 20:32:37 +00:00
third_party Prep for release 0.7.8. 2018-08-30 23:52:45 +01:00
.gitignore Fix for issue when hashing number formats. 2018-10-30 23:16:32 +00:00
.indent.pro Refactored the worksheet protection struct. 2019-11-17 12:51:10 +00:00
.travis.yml Add user defined function for formatting doubles. 2018-04-24 23:34:38 +01:00
Changes.txt Prep for release 0.8.8. 2019-11-17 18:51:49 +00:00
CMakeLists.txt CMake: Add /utf-8 MSVC compiler option for non-UTF-8 locales 2019-09-16 22:48:56 +01:00
CONTRIBUTING.md Add docs for lxw_version(). 2018-09-01 20:26:34 +01:00
libxlsxwriter.podspec Prep for release 0.8.8. 2019-11-17 18:51:49 +00:00
License.txt Updated copyright year. 2019-02-10 21:11:46 +00:00
Makefile Refactored the data validation struct. 2019-11-17 11:27:56 +00:00
Readme.md Add docs and an example for add_vba_project. 2019-06-19 00:21:04 +01:00

libxlsxwriter

Libxlsxwriter: A C library for creating Excel XLSX files.

demo image

The libxlsxwriter library

Libxlsxwriter is a C library that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.

It supports features such as:

  • 100% compatible Excel XLSX files.
  • Full Excel formatting.
  • Merged cells.
  • Defined names.
  • Autofilters.
  • Charts.
  • Data validation and drop down lists.
  • Worksheet PNG/JPEG images.
  • Support for adding Macros.
  • Memory optimization mode for writing large files.
  • Source code available on GitHub.
  • FreeBSD license.
  • ANSI C.
  • Works with GCC, Clang, Xcode, MSVC 2015, ICC, TCC, MinGW, MingGW-w64/32.
  • Works on Linux, FreeBSD, OpenBSD, OS X, iOS and Windows. Also works on MSYS/MSYS2 and Cygwin.
  • Compiles for 32 and 64 bit.
  • Compiles and works on big and little endian systems.
  • The only dependency is on zlib.

Here is an example that was used to create the spreadsheet shown above:

#include "xlsxwriter.h"

int main() {

    /* Create a new workbook and add a worksheet. */
    lxw_workbook  *workbook  = workbook_new("demo.xlsx");
    lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);

    /* Add a format. */
    lxw_format *format = workbook_add_format(workbook);

    /* Set the bold property for the format */
    format_set_bold(format);

    /* Change the column width for clarity. */
    worksheet_set_column(worksheet, 0, 0, 20, NULL);

    /* Write some simple text. */
    worksheet_write_string(worksheet, 0, 0, "Hello", NULL);

    /* Text with formatting. */
    worksheet_write_string(worksheet, 1, 0, "World", format);

    /* Write some numbers. */
    worksheet_write_number(worksheet, 2, 0, 123,     NULL);
    worksheet_write_number(worksheet, 3, 0, 123.456, NULL);

    /* Insert an image. */
    worksheet_insert_image(worksheet, 1, 2, "logo.png");

    workbook_close(workbook);

    return 0;
}

See the full documentation for the getting started guide, a tutorial, the main API documentation and examples.