xllify Packager
The xllify tool is the compiler and is the most important part of the entire solution.
It packages Luau and Python scripts into Excel add-ins (XLL files) without needing a C compiler, libraries or any other dependencies. (A copy of Microsoft Excel is useful for testing your work. 👍)
Installation
Download from xllify.com or use pip, if you're working with Python.
$ pip install xllify && xllify-installNote that this tool only runs on Windows. For Python add-ins, you and your end users will also need Python 3.10+ installed on your system.
Basic Usage
$ xllify <output.xll> [options] script1.luau script2.luau ...
$ xllify <output.xll> [options] script1.py script2.py ...Options
--py-entrypoint <module>- Python entrypoint module (default:main)--py-requirements <file>- Path to requirements.txt file to embed--help- Show help message
Examples
Luau only
xllify MyAddin.xll finance.luau forecasting.luauCreates an XLL with Luau functions that run at native speeds inside Excel's process.
Python only
xllify MyAddin.xll main.py utils.py --py-entrypoint main --py-requirements requirements.txtCreates an XLL with Python functions that run in an external process.
Mixed Luau and Python
xllify MyAddin.xll calculations.luau data_fetch.py --py-entrypoint data_fetchCombines both:
Luau functions run at native speeds inside Excel
Python functions run in n external processes with full library access
Both are available in Excel simultaneously
Development Workflow
For Luau
Rebuild the XLL whenever you change Luau code:
$ xllify MyAddin.xll finance.luauReload the XLL in Excel to see changes.
For Python
After building once, you can edit the extracted Python files directly:
# one off setup
pip install xllify
xllify-install
code main.py
<add some code>
# build
xllify MyAddin.xll main.py
<open MyAddin.xll in Excel and try function>
# cd into xll extraction dir and edit the live script
cd %LOCALAPPDATA%\xllify\MyAddin\python
code main.py
<make some changes and save>Changes take effect when you reload the XLL or restart the Python process.
To force re-extraction after rebuilding, delete %LOCALAPPDATA%\xllify\MyAddin\ and reopen Excel.
Python entrypoint
The --py-entrypoint option specifies which Python module to run. This module should contain your @xllify.fn() decorated functions, or just import them.
If you have multiple Python files, include them all.
xllify MyAddin.xll main.py utils.py helpers.py --py-entrypoint mainThe entrypoint module (main in this case) should import and register functions from other modules as needed.
Third-party dependencies
Use --py-requirements to bundle dependencies:
xllify MyAddin.xll main.py --py-entrypoint main --py-requirements requirements.txtThe requirements.txt file is embedded in the XLL and is automatically installed when the Python environment is set up on first load.
Note that if you specify a requirements.txt you need to include xllify as a dependency.
Output
The tool creates a single .xll file that can be loaded in Excel. This file contains:
Compiled Luau bytecode (if any)
Python scripts in a ZIP archive (if any)
Function metadata for Excel registration
Runtime flags set for the enablement async support
Troubleshooting
Last updated