Excel Keep-Format Edit for Openclaw

Edit targeted Excel values in place while preserving the original workbook design and validating financial statement balance.

lingyu9495-source
v1.1.2
Sep 26, 2026
0
196
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install excel-keep-format-edit

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install excel-keep-format-edit using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Excel Keep-Format Edit?

Excel Keep-Format Edit is an Openclaw Skills workflow for changing specific values in existing Excel and legacy XLS reports without rebuilding the workbook. It uses Excel COM through pywin32 to open a copy of the original file, modify only selected cells, and preserve fonts, borders, merged cells, conditional formatting, column widths, layout, and other native Excel details.

The skill is designed for financial reporting workflows such as audit adjustments, accounting corrections, financial projections, and reclassification of statement line items. It also locates target rows and columns by scanning labels instead of guessing coordinates, then performs balance checks across the balance sheet, income statement, and related financial data.

Excel Keep-Format Edit Use Cases

  • Update an existing Excel or XLS report while keeping its visual design unchanged.
  • Apply audit adjustments, accounting corrections, or financial statement reclassifications.
  • Modify retained earnings, revenue, expenses, receivables, or other targeted line items.
  • Adjust balance sheet values while maintaining assets = liabilities + equity.
  • Update legacy workbooks where rebuilding with openpyxl would damage formatting or layout.
  • Reconcile financial statements after changing beginning or ending retained earnings.
  • Locate accounting labels in two-column or side-by-side reports before editing values.
  • Validate that manually maintained totals and statement relationships remain consistent after edits.

How Excel Keep-Format Edit Works

  1. Identify the requested workbook, target statements, accounting labels, and values to change.
  2. Copy the source workbook to an output path so the original file remains untouched.
  3. Open the copied workbook with Microsoft Excel COM using pywin32; do not rebuild it with openpyxl.
  4. Scan worksheet labels to locate the actual target rows and columns. This is essential for side-by-side balance sheets where labels may be in column E and values may be in columns G or H.
  5. Account for Excel COM's 1-based row and column indexing rather than assuming coordinates from 0-based libraries such as xlrd.
  6. Write only the requested target cell values, leaving workbook formatting, styles, merged cells, widths, and layout unchanged.
  7. Recalculate the workbook where applicable, then manually recompute totals when the legacy XLS file stores totals as static numbers instead of formulas.
  8. Save and close the workbook through Excel COM.
  9. Verify accounting relationships, including assets = liabilities + equity and retained earnings movement versus cumulative profit.
  10. Report the output file and any validation results, including discrepancies that require manual review.

Excel Keep-Format Edit Setup

Requirements

  • Windows operating system.
  • Microsoft Excel installed and available to COM automation.
  • A Python environment used consistently for both installation and execution.
  • The pywin32 package installed in that environment.

Install the dependency in the agent's virtual environment:

python -m pip install pywin32

Run the editing script with the same virtual-environment Python interpreter. Installing pywin32 into one environment and running the script with system Python can cause win32com, pywintypes, or related import errors.

Operational guidance

  • Keep the original workbook unchanged and write edits to a copied output file.
  • Do not use python -I if it prevents the interpreter from seeing installed site packages.
  • Ensure Excel is closed cleanly after saving, including Workbook.Close and Excel.Quit.
  • Confirm the intended worksheet name before editing.
  • Avoid terminating Python processes blindly because the process may belong to a web application or gateway.
  • Use label scanning to confirm the target location before writing values, especially in two-sided financial statements.

Excel Keep-Format Edit Data Schema & Taxonomy

Workbook and output handling

Item Organization or rule
Source workbook Original .xls or Excel workbook supplied by the user; treated as read-only.
Output workbook A copied workbook edited in place through Excel COM.
Worksheet scope Target worksheets such as the balance sheet, income statement, or cash flow statement.
Cell addressing Excel COM uses 1-based row and column indexes.
Target discovery Scan visible labels and accounting subjects instead of relying on guessed row numbers.
Value updates Change only the requested cell .Value; preserve all other workbook properties.
Recalculation Request Excel calculation, but do not assume static legacy totals will update automatically.
Validation result Record balance checks and any unresolved discrepancies.

Financial metadata taxonomy

  • Balance sheet: current assets, non-current assets, liabilities, paid-in capital, retained earnings, total assets, total liabilities and equity.
  • Income statement: revenue, cost, administrative expenses, finance expenses, operating profit, non-operating income, profit before tax, income tax, and net profit.
  • Cash flow statement: cash-related movements and non-cash adjustments; normally unchanged when an adjustment has no cash receipt or payment.
  • Reconciliation rules: assets must equal liabilities plus equity; ending retained earnings minus beginning retained earnings should reconcile to cumulative profit where applicable.
  • Layout metadata: fonts, borders, merged cells, conditional formatting, column widths, worksheet arrangement, and other native Excel formatting remain in the copied workbook.

For side-by-side reports, the skill explicitly distinguishes left-side value columns such as C or D from right-side columns such as G or H. This prevents edits from being written to the wrong statement section.

Excel Keep-Format Edit Advanced Features

  • COM-native editing preserves legacy XLS formatting and workbook layout more reliably than reconstructing files with openpyxl.
  • Label-based row and column discovery reduces errors caused by hard-coded coordinates.
  • Supports side-by-side financial statements with separate label and value regions.
  • Uses copy-before-edit safeguards so the original workbook is retained for comparison or rollback.
  • Handles Excel recalculation while recognizing that static subtotal and total cells may require manual computation.
  • Supports balance-sheet validation for assets versus liabilities and equity.
  • Supports retained-earnings reconciliation against beginning balances and cumulative profit.
  • Includes practical safeguards for virtual-environment mismatches, COM indexing errors, incorrect left-versus-right column selection, and incomplete process cleanup.
  • Works as a focused Openclaw Skills automation for audit adjustments, accounting corrections, and controlled spreadsheet updates without redesigning the source report.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*