-
Notifications
You must be signed in to change notification settings - Fork 528
excel sheet
zmworm edited this page Jun 13, 2026
·
55 revisions
Worksheet management.
Path: /{SheetName} (e.g., /Sheet1, /Sales Data)
officecli get data.xlsx /Sheet1 officecli get data.xlsx /Sheet1 --depth 2
| Property | Accepted Values | Description |
|---|---|---|
freeze |
cell ref (e.g., A2, B3) or none/false
|
Freeze panes |
zoom / zoomscale
|
10-400 | Zoom scale percentage |
tabColor / tab_color
|
hex RGB, scheme name, or none
|
Sheet tab color. Scheme color names: accent1–accent6, lt1, dk1, lt2, dk2, bg1, bg2, tx1, tx2, hlink, folHlink (writes theme-indexed TabColor@theme; query readback echoes the symbolic name). |
name |
new sheet name | Rename sheet — also cascades into named-range references, formulas, internal hyperlinks, sparkline data refs, validation list refs, and CF formulas across all sheets. Duplicate names rejected. |
visibility |
visible / hidden / veryHidden
|
Three-state visibility. veryHidden is only toggleable via VBA in Excel itself; query distinguishes the three states. hidden=true is a convenience alias for visibility=hidden. |
margin.top / margin.bottom / margin.left / margin.right / margin.header / margin.footer
|
inches (decimal) | Print margin. Get returns the same keys. |
fittopage |
bool | Fit-to-page printing. false/none clears the flag and width/height overrides. |
sort |
sort spec | Sort rows — see Sort for full syntax, examples, and rejection rules |
sortHeader |
false |
Treat the first row as a header (excluded from reorder). Used with sort. |
direction / dir / rtl / rightToLeft / sheet.direction
|
rtl/ltr or bool |
Toggle the <x:sheetView rightToLeft="1"/> flag — used by Arabic/Hebrew layouts. Get returns canonical direction=rtl (matches Word/PPT). direction=ltr clears the attribute on default-LTR sheets. |
printTitleRows |
range (e.g. 1:1, 1ドル:2ドル, Sheet1!1ドル:1ドル) |
Repeat-on-print row range. Merged with printTitleCols into a single _xlnm.Print_Titles definedName per sheet. |
printTitleCols |
range (e.g. A:A, $A:$B) |
Repeat-on-print column range. |
officecli set data.xlsx /Sheet1 --prop freeze=A2 officecli set data.xlsx /Sheet1 --prop freeze=B2 officecli set data.xlsx /Sheet1 --prop freeze=none officecli set data.xlsx /Sheet1 --prop zoom=150 officecli set data.xlsx /Sheet1 --prop tabColor=FF0000 officecli set data.xlsx /Sheet1 --prop tabColor=none officecli set data.xlsx /Sheet1 --prop name=Revenue # Sort — see excel-sort for full docs officecli set data.xlsx /Sheet1 --prop sort="A asc, D desc" --prop sortHeader=true
officecli remove data.xlsx /Sheet2
Sheets that declare millions of value-less / formula-less / style-less empty cells balloon the SDK DOM to GBs. v1.0.112+ strips them at open time (lossless — Excel/LibreOffice discard such cells on load too). Gating is automatic: normal files use the original direct-stream path; bloated files operate on a slimmed in-memory copy and write back to the backing file on save/close, so mid-session snapshots and final closes still hit disk.
Based on OfficeCLI v1.0.112