Automating Excel
by SpillwaveSolutions
Automates Microsoft Excel on macOS via JXA with AppleScript dictionary discovery. Use when asked to "automate Excel spreadsheets", "JXA Excel scripting", "Excel macOS automation", or "bulk Excel data operations". Focuses on workbooks, worksheets, ranges, 2D arrays, performance toggles, and VBA escape hatches.
Skill Details
Repository Files
13 files in this skill directory
name: automating-excel description: Automates Microsoft Excel on macOS via JXA with AppleScript dictionary discovery. Use when asked to "automate Excel spreadsheets", "JXA Excel scripting", "Excel macOS automation", or "bulk Excel data operations". Focuses on workbooks, worksheets, ranges, 2D arrays, performance toggles, and VBA escape hatches. allowed-tools:
- Bash
- Read
- Write
Automating Excel (JXA-first, AppleScript discovery)
Relationship to the macOS automation skill
- Standalone for Excel, but aligned with
automating-mac-appspatterns. - Use
automating-mac-appsfor permissions, shell, and UI scripting guidance. - PyXA Installation: To use PyXA examples in this skill, see the installation instructions in
automating-mac-appsskill (PyXA Installation section).
Core Framing
- Excel AppleScript dictionary is AppleScript-first; use Script Editor for discovery.
- JXA is the production language for logic and data processing.
- Collections are specifiers; read via methods, set via assignments.
- Handle errors from Excel operations using try/catch blocks and Application error checking.
Workflow (default)
- Discover dictionary terms in Script Editor (Excel).
- Prototype a minimal AppleScript command.
- Port to JXA and add defensive checks.
- Use bulk read/write (2D arrays) for performance.
- Use VBA
run()when dictionary coverage is missing.
Validation Steps
- Test with empty documents to verify error handling
- Verify data integrity after batch operations
- Check Excel UI responsiveness after automation runs
- Log errors with specific Excel object paths for debugging
Examples
Basic workbook read:
const Excel = Application('Microsoft Excel');
const workbook = Excel.workbooks[0];
const worksheet = workbook.worksheets['Sheet1'];
const range = worksheet.ranges['A1:B10'];
const data = range.value(); // Returns 2D array
Bulk write with performance toggle:
Excel.screenUpdating = false;
Excel.calculation = 'manual';
try {
const range = worksheet.ranges['C1:D100'];
range.value = my2DArray;
} finally {
Excel.calculate();
Excel.screenUpdating = true;
}
VBA escape hatch:
Excel.run('MyMacro', {arg1: 'value', arg2: 123}); // Calls VBA subroutine
When Not to Use
- For general macOS automation without Excel involvement
- When AppleScript alone suffices (no JXA logic needed)
- For Excel tasks requiring complex UI interactions (use
automating-mac-appsfor that) - When cross-platform compatibility is required
What to load
- JXA Excel basics:
automating-excel/references/excel-basics.md - Recipes (ranges, 2D arrays, formatting):
automating-excel/references/excel-recipes.md - Advanced patterns (performance toggles, VBA bridge):
automating-excel/references/excel-advanced.md - Pivot table guidance:
automating-excel/references/excel-pivots.md - Charting guidance:
automating-excel/references/excel-charts.md - Dictionary translation table:
automating-excel/references/excel-dictionary.md - PyXA (Python) alternative:
automating-excel/references/excel-pyxa.md
Related Skills
Xlsx
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
Clickhouse Io
ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
Clickhouse Io
ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.
Analyzing Financial Statements
This skill calculates key financial ratios and metrics from financial statement data for investment analysis
Data Storytelling
Transform data into compelling narratives using visualization, context, and persuasive structure. Use when presenting analytics to stakeholders, creating data reports, or building executive presentations.
Kpi Dashboard Design
Design effective KPI dashboards with metrics selection, visualization best practices, and real-time monitoring patterns. Use when building business dashboards, selecting metrics, or designing data visualization layouts.
Dbt Transformation Patterns
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
Sql Optimization Patterns
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.
Anndata
This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling large-scale biological datasets. Use when tasks involve AnnData objects, h5ad files, single-cell RNA-seq data, or integration with scanpy/scverse tools.
Xlsx
Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis.
