
Excel Automation
Automate professional Excel reports, parse investment-bank-style xlsm models, and drive Excel on macOS without manual GUI work.
Overview
Excel Automation is an agent skill most often used in Build (also Operate, Grow) that creates, parses, and controls Excel files on macOS using openpyxl, zip/XML parsing, and AppleScript.
Install
npx skills add https://github.com/daymade/claude-code-skills --skill excel-automationWhat is this skill?
- Creates formatted workbooks with openpyxl via bundled uv scripts
- Parses complex xlsm/xlsx (>1MB, VBA-heavy) using stdlib zipfile plus xml.etree when openpyxl fails
- Controls Microsoft Excel on macOS with AppleScript (activate, zoom, scroll, select) with timeout guards
- Includes a three-way decision tree: create vs parse vs control
- Ships ready-to-run scripts: create_formatted_excel.py and parse_complex_excel.py
- Three documented capabilities: create (openpyxl), parse (zipfile+xml), control (AppleScript)
- Decision tree routes files by complexity including >1MB and VBA-heavy workbooks
Adoption & trust: 511 installs on skills.sh; 1.2k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need agent-driven Excel deliverables or model extraction on macOS, but openpyxl chokes on heavy xlsm files and manual Excel clicking does not scale.
Who is it for?
Solo builders on macOS who must ship Excel-native reports, audit financial models, or automate Excel windows for documentation pipelines.
Skip if: Windows or Linux Excel automation, teams that only need lightweight CSV/JSON exports, or workflows with no Microsoft Excel installed locally.
When should I use this skill?
Use when creating formatted Excel reports, parsing financial models that openpyxl cannot handle, or automating Excel on macOS.
What do I get? / Deliverables
You get scriptable creation of formatted workbooks, reliable parsing of complex models, and optional Excel UI control with documented tool choice per file type.
- Formatted xlsx output from create_formatted_excel.py
- Extracted sheet data or repaired names from parse_complex_excel.py
- Controlled Excel view state for downstream screenshot or review steps
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Spreadsheet automation is where solo builders wire deliverables and data exports into the product build, not where they first discover an idea. The skill connects Python, zip/XML parsing, and AppleScript to Excel—classic integration work alongside other backend and tooling hooks.
Where it fits
Generate a formatted monthly KPI workbook from pipeline data before shipping a client dashboard.
Re-parse an updated xlsm ops model and extract one sheet without opening broken names in Excel manually.
Refresh investor-facing tables in a native Excel template for a fundraising update.
How it compares
Use this skill for macOS Excel file and app control—not a generic spreadsheet MCP or cloud-only sheet API integration.
Common Questions / FAQ
Who is excel-automation for?
Indie and solo developers on macOS who deliver xlsx/xlsm artifacts, parse banking-style models, or script Excel as part of agent workflows.
When should I use excel-automation?
During Build when wiring reporting integrations; during Operate when refreshing models or exports; during Grow when updating investor or ops spreadsheets—whenever formatted Excel or stubborn xlsm parsing is required on Mac.
Is excel-automation safe to install?
Review the Security Audits panel on this Prism page and inspect bundled scripts before running shell or AppleScript commands against real workbooks.
SKILL.md
READMESKILL.md - Excel Automation
# Excel Automation Create professional Excel files, parse complex financial models, and control Excel on macOS. ## Quick Start ```bash # Create a formatted Excel report uv run --with openpyxl scripts/create_formatted_excel.py output.xlsx # Parse a complex xlsm that openpyxl can't handle uv run scripts/parse_complex_excel.py model.xlsm # List sheets uv run scripts/parse_complex_excel.py model.xlsm "DCF" # Extract a sheet uv run scripts/parse_complex_excel.py model.xlsm --fix # Fix corrupted names # Control Excel via AppleScript (with timeout to prevent hangs) timeout 5 osascript -e 'tell application "Microsoft Excel" to activate' ``` ## Overview Three capabilities: | Capability | Tool | When to Use | |-----------|------|-------------| | **Create** formatted Excel | `openpyxl` | Reports, mockups, dashboards | | **Parse** complex xlsm/xlsx | `zipfile` + `xml.etree` | Financial models, VBA workbooks, >1MB files | | **Control** Excel window | AppleScript (`osascript`) | Zoom, scroll, select cells programmatically | ## Tool Selection Decision Tree ``` Is the file simple (data export, no VBA, <1MB)? ├─ YES → openpyxl or pandas └─ NO ├─ Is it .xlsm or from investment bank / >1MB? │ └─ YES → zipfile + xml.etree.ElementTree (stdlib) └─ Is it truly .xls (BIFF format)? └─ YES → xlrd ``` **Signals of "complex" Excel**: file >1MB, `.xlsm` extension, from investment bank/broker, contains VBA macros. **IMPORTANT**: Always run `file <path>` first — extensions lie. A `.xls` file may actually be a ZIP-based xlsx. ## Creating Excel Files (openpyxl) ### Professional Color Convention (Investment Banking Standard) | Color | RGB Code | Meaning | |-------|----------|---------| | Blue | `0000FF` | User input / assumption | | Black | `000000` | Calculated value | | Green | `008000` | Cross-sheet reference | | White on dark blue | `FFFFFF` on `4472C4` | Section headers | | Dark blue text | `1F4E79` | Title | ### Core Formatting Patterns ```python from openpyxl.styles import Font, PatternFill, Border, Side, Alignment # Fonts BLUE_FONT = Font(color="0000FF", size=10, name="Calibri") BLACK_FONT_BOLD = Font(color="000000", size=10, name="Calibri", bold=True) GREEN_FONT = Font(color="008000", size=10, name="Calibri") HEADER_FONT = Font(color="FFFFFF", size=12, name="Calibri", bold=True) # Fills DARK_BLUE_FILL = PatternFill("solid", fgColor="4472C4") LIGHT_BLUE_FILL = PatternFill("solid", fgColor="D9E1F2") INPUT_GREEN_FILL = PatternFill("solid", fgColor="E2EFDA") LIGHT_GRAY_FILL = PatternFill("solid", fgColor="F2F2F2") # Borders THIN_BORDER = Border(bottom=Side(style="thin", color="B2B2B2")) BOTTOM_DOUBLE = Border(bottom=Side(style="double", color="000000")) ``` ### Number Format Codes | Format | Code | Example | |--------|------|---------| | Currency | `'$#,##0'` | $1,234 | | Currency with decimals | `'$#,##0.00'` | $1,234.56 | | Percentage | `'0.0%'` | 12.3% | | Percentage (2 decimal) | `'0.00%'` | 12.34% | | Number with commas | `'#,##0'` | 1,234 | | Multiplier | `'0.0x'` | 1.5x | ### Conditional Formatting (Sensitivity Tables) Red-to-green gradient for sensitivity analysis: ```python from openpyxl.formatting.rule import ColorScaleRule rule = ColorScaleRule( start_type="min", start_color="F8696B", # Red (low) mid_type="percentile", mid_value=50, mid_color="FFEB84", # Yellow (mid) end_type="max", end_color="63BE7B" # Green (high) ) ws.conditional_formatting.add(f"B2:F6", rule) ``` ### Execution ```bash uv run --with openpyxl scripts/create_formatted_excel.py ``` Full template script: S