Creating Excel files with Lua and Xlsxwriter

Xlsxwriter is a Lua module for creating Excel XLSX files.


(Sample code to create the above spreadsheet.)


Xlsxwriter 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 formatting.
  • Memory optimisation mode for writing large files.
  • Merged cells.
  • Worksheet setup methods.
  • Defined names.
  • Document properties.

It works with Lua 5.1 and Lua 5.2.

This document explains how to use the xlsxwriter module. See the following sections for more information, or jump straight to the Introduction.