RPA-style Excel automation for AI agents. Give your OpenClaw agent full control over the live Excel application — open workbooks, write data, create dashboards, run macros, and do everything a human can do, but faster.
Unlike file-based libraries (openpyxl, pandas) that manipulate .xlsx files on disk, excel-controller drives the running Excel application in real time — the same way a human would click and type:
- Open, create, save, and close workbooks
- Navigate sheets, select cells, read and write data
- Write formulas that Excel calculates natively
- Format cells: fonts, colors, borders, number formats, alignment
- Create charts: bar, line, pie, combo, radar, scatter
- Build pivot tables with custom fields and aggregations
- Add conditional formatting, data validation, and dropdowns
- Run existing VBA macros or inject and execute new ones at runtime
- Build complete multi-sheet dashboards with KPI cards
- Export sheets to PDF
- Sort, filter, and auto-fit columns
Platform support:
| Platform | Engine | Package |
|---|---|---|
| Windows | COM Automation (win32com.client) |
pywin32 |
| macOS | xlwings bridge | xlwings |
| Linux | Not supported | Use excel-master instead |
- Microsoft Excel (or Microsoft 365) must be installed
- Python 3.8+
git clone https://github.com/3bslam/excel-controller-openclaw-skill.git# Per-workspace (recommended)
cp -r excel-controller-openclaw-skill/excel-controller \
~/.openclaw/workspace/skills/excel-controller
# Or shared across all agents
cp -r excel-controller-openclaw-skill/excel-controller \
~/.openclaw/skills/excel-controller# Windows (full COM automation — recommended)
pip install pywin32
# macOS (xlwings bridge)
pip install xlwings
# Optional: data manipulation helpers
pip install pandas openpyxlIf you want the agent to inject and run VBA code at runtime:
Excel → File → Options → Trust Center → Trust Center Settings → Macro Settings → ☑ Trust access to the VBA project object model
/new
# or
openclaw gateway restartOnce installed, just describe what you want in natural language:
"Open Excel and create a sales dashboard with bar charts and KPI cards"
"Open my quarterly report and add a pivot table by region"
"Format the header row — dark blue background, white bold text"
"Create a line chart showing the revenue trend across Q1–Q4"
"Run the CalculateAll macro in this workbook"
"Add conditional formatting: green above 1000, red below 500"
"Export the Dashboard sheet to PDF"
The agent uses scripts/excel_safe.py automatically to manage the COM session safely.
In ~/.openclaw/openclaw.json:
{
"skills": {
"entries": {
"excel_controller": {
"enabled": true
}
}
}
}excel-controller-openclaw-skill/
├── README.md # This file
├── LICENSE # MIT
├── .gitignore
└── excel-controller/
├── SKILL.md # Skill definition (frontmatter + full reference)
├── README.md # Quick-start guide
└── scripts/
└── excel_safe.py # COM session manager + formatting helpers
A production-ready helper that provides:
| Export | Description |
|---|---|
excel_session(visible, display_alerts) |
Context manager — handles COM init, Excel launch, and guaranteed cleanup |
rgb(r, g, b) |
Converts RGB to Excel's BGR integer format |
COLORS |
Professional color palette (header blue, input blue, positive green, etc.) |
format_header(ws, range, ...) |
One-call header formatting |
format_currency(ws, range, fmt) |
Apply currency number format |
format_percentage(ws, range, decimals) |
Apply percentage format |
add_borders(ws, range, weight, color) |
Add borders to a range |
auto_fit(ws) |
Auto-fit all columns and rows |
write_data_block(ws, start_cell, data) |
Bulk-write a 2D list (much faster than cell-by-cell) |
disable_updates(excel) |
Turn off screen update + manual calc for performance |
enable_updates(excel) |
Re-enable screen update + auto calc |
Example:
from excel_safe import excel_session, write_data_block, format_header, rgb
with excel_session(visible=True) as excel:
wb = excel.Workbooks.Add()
ws = wb.ActiveSheet
ws.Name = "Sales"
headers = [["Product", "Q1", "Q2", "Q3", "Q4"]]
data = [
["Product A", 15000, 18000, 17500, 21000],
["Product B", 12000, 13500, 14200, 16800],
]
write_data_block(ws, "A1", headers + data)
format_header(ws, "A1:E1")
wb.SaveAs(r"C:\Users\me\Documents\sales.xlsx")| Feature | excel-controller | excel-master |
|---|---|---|
| Controls live Excel app | ✅ | ❌ |
| Requires Excel installed | ✅ | ❌ (uses LibreOffice) |
| Real-time formula recalc | ✅ Native | |
| VBA macros | ✅ Full | ❌ |
| Pivot tables | ✅ Native | ❌ |
| Charts | ✅ Full Excel | |
| Works on Linux | ❌ | ✅ |
| Headless / server use | ✅ | |
| Speed on large files | ✅ Fast |
Use excel-controller when you need the full power of Excel — dashboards, pivot tables, VBA, real-time formulas, and interactive work on Windows/macOS.
Use excel-master when you need to create or process files on a server, in CI/CD, or on Linux.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-improvement) - Commit your changes
- Open a Pull Request
For bug reports and feature requests, please open an issue.
This skill is a community contribution to the OpenClaw ecosystem. If you build something useful with it, share it — open an issue or discussion to show what you've made.
MIT — free to use, modify, and distribute.