xlwings lets Python and Excel call each other for automation, macros, and user-defined functions on Windows, macOS, and Excel on the web.
Overview
xlwings is an open-source Python package that connects Excel workbooks to Python code. You can drive Excel from Python with a VBA-like feel, replace macros with Python, and define user-defined functions on Windows. NumPy arrays and pandas DataFrames are supported, and workbooks can be shared across Windows and macOS desktops.
xlwings Lite is an Excel add-in from Microsoft's store that stores Python inside the workbook, exposes custom functions and the Excel object model, and works without a local Python install on Windows, macOS, and Excel on the web. A separate commercial xlwings Server offering runs Python on infrastructure you control for add-ins, SSO, and role-based access, but the core open-source library expects local Excel plus Python on desktop platforms.
Typical workflows include reporting pipelines, button-triggered macros, Jupyter-driven interaction, and custom function libraries. Commercial xlwings PRO adds templated reporting and related features under separate licensing.
Analysts and developers who automate spreadsheets or embed Python logic in Excel choose xlwings instead of maintaining large VBA codebases.
Key features
- Python automation of Excel
- Python macros from workbook buttons
- User-defined functions on Windows
- NumPy and pandas data exchange
- xlwings Lite add-in option
- Jupyter notebook interaction
- Cross-platform desktop workbooks
Use cases
- Replacing VBA with Python
- Automated Excel reporting
- Custom spreadsheet functions
- Data pulls into workbooks