Skip to content

command add excel

zmworm edited this page Apr 29, 2026 · 52 revisions

add - Excel (.xlsx)

Addable element types in Excel documents.

Element Types

Type Aliases Parent Reference
sheet - / Excel-Sheet-Add
cell - /{SheetName} Excel-Cell-Add
row - /{SheetName} Excel-Cell-Add
validation datavalidation /{SheetName} Excel-Validation-Add
table listobject /{SheetName} Excel-Table-Add
comment note /{SheetName} Excel-Comment-Add
namedrange definedname / Excel-NamedRange-Add
picture image /{SheetName} Excel-Picture-Add
chart - /{SheetName} Excel-Chart-Add
databar conditionalformatting /{SheetName} Excel-ConditionalFormatting-Add
colorscale - /{SheetName} Excel-ConditionalFormatting-Add
iconset - /{SheetName} Excel-ConditionalFormatting-Add
formulacf - /{SheetName} Excel-ConditionalFormatting-Add
autofilter - /{SheetName} Excel-AutoFilter-Add
pivottable pivot /{SheetName} Excel-PivotTable-Add
shape - /{SheetName} Excel-Shape-Add
textbox - /{SheetName} Excel-Shape-Add
sparkline - /{SheetName} Excel-Sparkline-Add
csv tsv /{SheetName} Import CSV/TSV data (see Command Reference)
ole oleobject, embed, embeddedobject /{SheetName} Excel-OLE-Add

OLE / Embedded Object

Embed an Office (or other OLE-compatible) document as an object inside the worksheet. Excel anchors the object to a cell range.

Property Required Description
src yes Path to the file to embed (.docx, .xlsx, .pptx, .pdf, etc.). Alias: path.
progId no OLE ProgID (e.g. Word.Document.12, Excel.Sheet.12, Package). Auto-detected from src extension when omitted.
width no Display width as unit-qualified size (6cm, 2in, 160pt) or raw EMU.
height no Display height as unit-qualified size (4cm, 1.5in, 120pt) or raw EMU.
icon no Path to a custom icon image used when the object is rendered as an icon.
anchor no Cell range (B2:E6) or single cell (B2). When provided, width/height in the same call are ignored (anchor defines the full rectangle).
x, y no Alternative to anchor — 0-based column/row index for the top-left anchor cell.

Note: Excel OLE objects do not accept the display property (Excel always renders worksheet OLE as an icon) or the name property (the SpreadsheetML x:oleObject schema has no Name attribute). Both will throw if passed.

Examples

# Embed a Word document at cell A1 with default size
officecli add book.xlsx /Sheet1/A1 --type ole --prop src=memo.docx

# Embed a PowerPoint deck at 6cm × 4cm
officecli add book.xlsx /Sheet1/B2 --type ole --prop src=deck.pptx --prop width=6cm --prop height=4cm

# Embed a PDF anchored to a specific cell range
officecli add book.xlsx /Sheet1/A1 --type ole --prop src=report.pdf --prop anchor=D4:H12

See Also


Based on OfficeCLI v1.0.64

Clone this wiki locally