xlsx

Create, edit, and recalculate Excel workbooks with openpyxl, pandas, and LibreOffice.

52|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/Immortalqx/my_codex_skills --skill xlsx-immortalqx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xlsx
Source: https://github.com/Immortalqx/my_codex_skills/tree/main/xlsx
Command: npx skills add https://github.com/Immortalqx/my_codex_skills --skill xlsx-immortalqx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openpyxl, pandas, defusedxml, lxml, and includes scripts (resource) components.

What problem does it solve? Spreadsheet work often breaks workbook structure, hardcodes values that should be formulas, or ships files with hidden Excel errors. This Skill provides a disciplined workflow for creating, inspecting, repairing, and extending .xlsx, .xlsm, .csv, and .tsv files while preserving formulas, formatting, and multi-sheet structure. ## Core Features & Use Cases - Structure-preserving editing: Uses openpyxl to modify existing workbooks without losing formulas, named sheets, comments, or formatting. - Formula-first rule: Enforces writing real Excel formulas (e.g., =SUM(B2:B9)) instead of hardcoding Python-computed values. - Automated recalculation and error scanning: The bundled scripts/recalc.py drives LibreOffice headless to recalculate formulas and reports #REF!, #DIV/0!, #VALUE!, and other errors as JSON with cell locations. - Use Case: You receive a messy CSV export and need a formatted financial workbook with assumption cells, computed columns, and a summary sheet. The Skill builds it with openpyxl, keeps inputs visually distinct from outputs, and verifies the file recalculates cleanly before handoff. ## Quick Start Use the xlsx skill to turn this CSV into a formatted Excel workbook with real formulas and verify it recalculates without errors.

Frequently Asked Questions about xlsx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I edit an Excel file in Python without losing formulas?

Use openpyxl's load_workbook to open the existing file, which preserves formulas, formatting, named sheets, and comments. Make your edits on the worksheet objects and save, then recalculate with LibreOffice to confirm formulas still resolve correctly.

Should I use openpyxl or pandas for Excel files?

Use openpyxl when workbook structure, formulas, styling, or multiple sheets must be preserved. Use pandas for data cleaning, joins, aggregation, and reshaping, then write the final output with openpyxl if formulas or formatting matter.

How do I recalculate Excel formulas from Python?

Run the bundled recalc.py script, which drives LibreOffice headless with a Basic macro that calls calculateAll and saves the file. It returns JSON with total formula count and any Excel errors found per cell.

Why does my Excel file show #REF! or #DIV/0! errors after editing?

#REF! appears when row or column edits invalidate formula references, and #DIV/0! occurs when a denominator can be zero. The recalc.py script scans all sheets and reports each error type with its sheet and cell location so you can fix them.

Can this handle CSV and TSV files as well as xlsx?

Yes, the workflow covers .xlsx, .xlsm, .csv, and .tsv files. CSV and TSV data is typically loaded with pandas for cleaning and reshaping, then written out as a formatted Excel workbook when structure or formulas are needed.