Skip to content

excel reference

zmworm edited this page Mar 31, 2026 · 23 revisions

Excel (.xlsx) Reference

Complete reference for OfficeCLI operations on Excel documents.

Elements

Element Path Operations
Sheet /{SheetName} or /[N] add, move
Cell /{SheetName}/A1 add, set
Validation /{SheetName}/validation[N] add, set
Table /{SheetName}/table[N] add, set, remove
Comment /{SheetName}/comment[N] add
Named Range /namedrange[Name] add, set
Picture /{SheetName}/picture[N] add, set
Shape / Textbox /{SheetName}/shape[N] add
Chart /{SheetName}/chart[N] add, set, remove
Conditional Formatting /{SheetName}/cf[N] add
AutoFilter /{SheetName}/autofilter add, remove
Sparkline /{SheetName}/sparkline[N] add, set, remove
Pivot Table /{SheetName}/pivottable[N] add, set

Path Notation

Excel-native path notation is accepted as an alias for DOM-style paths:

Excel Notation DOM Path Description
Sheet1!A1 /Sheet1/A1 Single cell
Sheet1!A1:D10 /Sheet1/A1:D10 Cell range
Sheet1!row[2] /Sheet1/row[2] Row by index
Sheet1!1:1 /Sheet1/row[1] Whole row (N:N notation)
Sheet1!A:A /Sheet1/col[A] Whole column (Col:Col notation)

Both notations work in all commands (get, set, add, remove, query).

Sheets can also be addressed by 1-based index: /[1] resolves to the first sheet, /[2] to the second, etc.

Find & Replace

# Document-wide find and replace
officecli set data.xlsx / --prop find="2025" --prop replace="2026"

# Sheet-level find and replace
officecli set data.xlsx /Sheet1 --prop find="Draft" --prop replace="Final"

Sheet Operations

# Reorder sheet to position 1
officecli move data.xlsx /Sheet2 --index 1

# Column auto-fit (single column or all)
officecli set data.xlsx /Sheet1/col[A] --prop autoFit=true
officecli set data.xlsx /Sheet1 --prop autoFit=true

# Toggle gridlines and row/column headers
officecli set data.xlsx /Sheet1 --prop gridlines=false
officecli set data.xlsx /Sheet1 --prop headings=false

Workbook Root

Path: /

Document Properties

Property Description
title Document title
author / creator Author name
subject Subject
description Description
category Category
keywords Keywords
lastmodifiedby Last modified by
revision Revision number
created Creation date
modified Last modified date
officecli get data.xlsx /
officecli get data.xlsx / --depth 2
officecli set data.xlsx / --prop title="Q4 Report" --prop author="John Doe"

Formula Evaluation

OfficeCLI includes a built-in formula evaluator with 150+ functions. Formulas are automatically evaluated at write time and results cached in the workbook.

Supported categories: Math (42), Trig (16), Statistical (15), Logical (11), Text (27), Lookup (6: VLOOKUP, HLOOKUP, INDEX, MATCH, OFFSET, INDIRECT), Date/Time (18), Financial (12: FV, PV, PMT, IRR, etc.), Info (12), Conditional aggregation (8: SUMIF, COUNTIF, AVERAGEIF, etc.), Conversion (12).

# Formula is auto-evaluated and result cached
officecli set data.xlsx /Sheet1/B10 --prop formula="=SUM(B2:B9)"

View Modes

Mode Description
text Plain text dump of cell values
annotated Cell values with formatting metadata
outline Structural overview (sheets, tables, charts)
stats Summary statistics (row/column counts, data types)
issues Potential problems (empty sheets, broken formulas, missing refs)
html Interactive HTML with formatting, charts, sheet tabs
officecli view data.xlsx text
officecli view data.xlsx stats
officecli view data.xlsx issues
officecli view data.xlsx html --browser

Raw XML Parts

Part Path Description
/ or /workbook Workbook XML
/styles Stylesheet XML
/sharedstrings Shared string table
/{SheetName} Worksheet XML
/{SheetName}/drawing Drawing container
/{SheetName}/chart[N] Chart XML

XPath prefixes: x (SpreadsheetML), r (Relationships), a (DrawingML), c (Charts)

officecli raw data.xlsx /Sheet1 --start 1 --end 50 --cols A,B,C
officecli raw data.xlsx /styles

Based on OfficeCLI v1.0.28

Clone this wiki locally