Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Get-OfficeExcelDataValidation

Aliases: ExcelDataValidation
Module PSWriteOffice
Aliases
ExcelDataValidation
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Management.Automation.PSObject

Gets data validation rules from one or more Excel worksheets.

Syntax

Get-OfficeExcelDataValidation [-HeaderName <String>] [-HeaderRow <Int32>] [-IncludeHeader] [-Range <String>] [-Sheet <String>] [-SheetIndex <Int32>] [-TableName <String>] [<CommonParameters>]
#
Parameter set: Context
Get-OfficeExcelDataValidation [-HeaderName <String>] [-HeaderRow <Int32>] [-IncludeHeader] [-Path] <String> [-Range <String>] [-Sheet <String>] [-SheetIndex <Int32>] [-TableName <String>] [<CommonParameters>]
#
Parameter set: Path
Get-OfficeExcelDataValidation -Document <ExcelDocument> [-HeaderName <String>] [-HeaderRow <Int32>] [-IncludeHeader] [-Range <String>] [-Sheet <String>] [-SheetIndex <Int32>] [-TableName <String>] [<CommonParameters>]
#
Parameter set: Document

Examples

Authored help example

Inspect validation rules in a workbook.

Get-OfficeExcelDataValidation -Path .\Report.xlsx -Sheet Data |
                Select-Object -Property SheetName, Range, Type, Operator, Formula1, Formula2

Returns validation metadata for workbook audits and maintenance workflows.

Parameters

-HeaderName String optionalaliases: ColumnName
Header or table column name used to resolve the range filter.
-HeaderRow Int32 optional
Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
-IncludeHeader SwitchParameter optional
Include the header cell in the resolved range.
-Range String optional
Optional A1 range filter.
-Sheet String optional
Worksheet name to inspect. Defaults to the current DSL sheet or all workbook sheets.
-SheetIndex Int32 optional
Worksheet index (0-based) to inspect. Defaults to the current DSL sheet or all workbook sheets.
-TableName String optional
Optional table name for header-based range resolution.
-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path
Workbook path to inspect.
-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document
Workbook to inspect outside the DSL context.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.