Skip to content

excel shape

zmworm edited this page Mar 31, 2026 · 20 revisions

Excel: Shape / Textbox

Shape and textbox elements in a worksheet.

Path: /{SheetName}/shape[N]

Operations

Operation Description
add Insert a shape or textbox
get Get shape properties
set Modify shape properties
query Query shapes by type in selectors
remove Remove a shape

Get

Returns: name, text, x, y, width, height, size (pt), bold, italic, color, font, fill, shadow, glow

officecli get data.xlsx /Sheet1/shape[1]

Set

Property Description
x Column offset
y Row offset
width Column span
height Row span
name Shape name
text Text content (supports \n for line breaks)
font Font typeface
size Font size in pt
bold Bold text
italic Italic text
color Font color (hex)
fill Fill color (hex) or "none" for transparent
align Text alignment: left, center/c/ctr, right/r
shadow Shadow effect
glow Glow effect
reflection Reflection effect
softedge Soft edge radius in pt

Note: When fill=none, effects (shadow, glow, reflection, softedge) apply to text runs instead of the shape.

officecli set data.xlsx /Sheet1/shape[1] --prop text="Updated text" --prop fill=4472C4
officecli set data.xlsx /Sheet1/shape[1] --prop shadow=true --prop glow="FF0000-10"

Query

officecli get data.xlsx /Sheet1/shape --query "type=shape"
officecli get data.xlsx /Sheet1/shape --query "type=textbox"

Remove

officecli remove data.xlsx /Sheet1/shape[1]

Based on OfficeCLI v1.0.28

Clone this wiki locally