Skip to content

excel validation get

zmworm edited this page Apr 4, 2026 · 28 revisions

Excel: Data Validation - get

Get data validation rule properties.

Path: /{SheetName}/validation[N]

Attributes

Attribute Type Description
sqref string Cell range the validation applies to (e.g., A1:A100)
type string Validation type (list, whole, decimal, date, time, textLength, custom)
operator string Comparison operator (between, notBetween, equal, notEqual, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual)
formula1 string First formula or value constraint
formula2 string Second formula or value constraint (used with between/notBetween)
allowBlank boolean Whether blank values are allowed
showError boolean Whether to show an error alert on invalid input
showInput boolean Whether to show an input message when cell is selected
errorTitle string Title of the error alert dialog
error string Error alert message text
promptTitle string Title of the input prompt
prompt string Input prompt message text

Examples

# Get a validation rule
officecli get data.xlsx /Sheet1/validation[1]
/Sheet1/validation[1]
  sqref: B2:B50
  type: list
  formula1: "Open,Closed,Pending"
  allowBlank: true
  showError: true
  showInput: true
  errorTitle: Invalid Status
  error: Please select a valid status.
  promptTitle: Status
  prompt: Choose a status from the dropdown.
# Get as JSON
officecli get data.xlsx /Sheet1/validation[1] --json

See Also


Based on OfficeCLI v1.0.33

Clone this wiki locally