-
Notifications
You must be signed in to change notification settings - Fork 465
excel namedrange add
zmworm edited this page Apr 29, 2026
·
51 revisions
Add a named range (defined name) to the workbook.
Path: / (workbook root), or /namedrange[NAME] to address an existing name by identifier
| Property | Default | Description |
|---|---|---|
name |
(required) | Name identifier (e.g., TaxRate). Must start with a letter or underscore, no spaces, and must not parse as a cell reference — validated per OOXML §18.2.5; invalid names throw at add. |
ref / refersTo
|
(required) | Cell/range reference (e.g., Sheet1!A1, Sheet1!A1:B10) |
scope |
workbook |
workbook or sheet name for sheet-level scope |
comment |
Description of the named range | |
volatile |
false |
Mark the name as volatile (formulas re-evaluate on every recalc). |
/namedrange[@name=X] is supported as a query/get/set selector (in addition to the positional /namedrange[N]).
officecli add data.xlsx / --type namedrange --prop name="TaxRate" --prop ref="Sheet1!B1"
officecli add data.xlsx / --type namedrange --prop name="SalesRange" --prop ref="Sheet1!A1:D100" --prop comment="All sales data"
officecli add data.xlsx / --type namedrange --prop name="LocalName" --prop ref="Sheet1!C1:C50" --prop scope="Sheet1"Based on OfficeCLI v1.0.64