modify_grid_structure
Insert or delete rows or columns and automatically rewrite every formula, defined name, validation, conditional format, table, and merged range so the workbook stays coherent.
Instructions
Insert or delete rows or columns at a position and REWRITE EVERY REFERENCE so the workbook stays coherent: formulas on every sheet (cross-sheet refs included), defined names, data validations, conditional-format ranges, table refs, and merged ranges all shift with the edit. action is insert_rows, delete_rows, insert_cols, or delete_cols; at is the 1-based row number or column letter where the edit starts (a cell like 'B7' or a location object also works, using its top-left); count edits that many at once.
Whole-column spans like =SUM(B:B) and whole-row spans like $1:$2 shift on their own axis; an edit on the other axis leaves them alone (Excel's behavior). A reference wholly inside a deleted band becomes #REF! and the new-#REF! count is reported, never hidden; an insert that would push value-bearing cells off the grid edge refuses. Returns per-kind rewrite counts. A hazardous workbook refuses unless allow_loss is true. Auto-backup: prev/anchor slots in .ks4xl-backups (backup=false skips rotation); atomic verified save, restored on failed verify; the prev slot is the undo for a delete. Refuses while open in Excel.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | Yes | ||
| path | Yes | ||
| count | No | ||
| sheet | No | ||
| action | Yes | ||
| backup | No | ||
| allow_loss | No | ||
| verify_com | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||