# Rename-OfficeExcelNamedRange

Renames a workbook or sheet-scoped Excel named range.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ExcelNamedRangeRename

**Module**

`PSWriteOffice`

**Aliases**

`ExcelNamedRangeRename`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Outputs**

`System.Boolean`

**Source**

[RenameOfficeExcelNamedRangeCommand.cs:20](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/RenameOfficeExcelNamedRangeCommand.cs#L20) 

Renames a workbook or sheet-scoped Excel named range.

## Syntax

```
Rename-OfficeExcelNamedRange
[-Global]
[-Name] <String>
[-NewName] <String>
[-PassThru]
[-Save]
[-ValidationMode <Sanitize|Strict>]
[<CommonParameters>]
```

[#](#method-rename-officeexcelnamedrange-switchparameter-string-string-switchparameter-switchparameter-exceldefinednamevalidationmode)

Parameter set: `Context`

```
Rename-OfficeExcelNamedRange
-Document <ExcelDocument>
[-Name] <String>
[-NewName] <String>
[-PassThru]
[-Save]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-ValidationMode <Sanitize|Strict>]
[<CommonParameters>]
```

[#](#method-rename-officeexcelnamedrange-exceldocument-string-string-switchparameter-switchparameter-string-int32-exceldefinednamevalidationmode)

Parameter set: `Document`

## Examples

### Rename a named range and keep the workbook reusable.

```powershell
$workbook = Get-OfficeExcel -Path .\Report.xlsx
$renamed = $workbook | Rename-OfficeExcelNamedRange -Name RevenueRange -NewName Revenue_Current -PassThru
Save-OfficeExcel -Document $workbook
```

Renames the defined name through OfficeIMO validation before saving the workbook.

## Parameters

**-Global SwitchParameter optionalsets: Context**

Use workbook-global scope from inside the DSL.

**-Name String requiredposition: 0**

Named range name.

**-NewName String requiredposition: 1**

New named range name.

**-PassThru SwitchParameter optional**

Emit a result object.

**-Save SwitchParameter optional**

Save the workbook immediately after renaming the name.

**-ValidationMode ExcelDefinedNameValidationMode optional**

Defined-name validation mode.

Possible values: `Sanitize`, `Strict`

**-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document**

Workbook document.

**-Sheet String optionalsets: Document**

Worksheet name for a sheet-scoped operation.

**-SheetIndex Int32 optionalsets: Document**

Zero-based worksheet index for a sheet-scoped operation.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:67A843D3063D012CE61D65EC7F6345356950538288E4C228BD1BCB7CF45838F4 -->
