OfficeIMO

API Reference

Command

Set-OfficeExcelNamedRange

Namespace PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Object

Creates or updates a named range.

Remarks

Creates or updates a named range.

Examples

Define a named range inside a sheet.


PS>ExcelSheet 'Data' { Set-OfficeExcelNamedRange -Name 'Totals' -Range 'B2:B50' }
        

Creates a sheet-scoped name for the range.

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.

Syntax

Set-OfficeExcelNamedRange [-Global] [-Hidden] -Name <String> [-PassThru] -Range <String> [-Save] [-ValidationMode <Sanitize|Strict>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Global SwitchParameter optionalposition: namedpipeline: False
Force a workbook-global name even inside a sheet block.
Hidden SwitchParameter optionalposition: namedpipeline: False
Mark the defined name as hidden.
Name String requiredposition: 0pipeline: False
Name of the defined range.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the name after creation.
Range String requiredposition: 1pipeline: False
Range in A1 notation.
Save SwitchParameter optionalposition: namedpipeline: False
Save the workbook immediately after setting the name.
ValidationMode NameValidationMode optionalposition: namedpipeline: Falsevalues: 2
Validate or sanitize the defined name.
Possible values: Sanitize, Strict

Outputs

System.Object

Set-OfficeExcelNamedRange -Document <ExcelDocument> [-Hidden] -Name <String> [-PassThru] -Range <String> [-Save] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-ValidationMode <Sanitize|Strict>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
Hidden SwitchParameter optionalposition: namedpipeline: False
Mark the defined name as hidden.
Name String requiredposition: 0pipeline: False
Name of the defined range.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the name after creation.
Range String requiredposition: 1pipeline: False
Range in A1 notation.
Save SwitchParameter optionalposition: namedpipeline: False
Save the workbook immediately after setting the name.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.
ValidationMode NameValidationMode optionalposition: namedpipeline: Falsevalues: 2
Validate or sanitize the defined name.
Possible values: Sanitize, Strict

Outputs

System.Object