API Reference

Cmdlet

Remove-OfficeExcelNamedRange

Aliases: ExcelNamedRangeRemove
Namespace PSWriteOffice
Aliases
ExcelNamedRangeRemove
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Boolean

Removes a workbook or sheet-scoped Excel named range.

Remarks

Removes a workbook or sheet-scoped Excel named range.

Examples

Authored help example

Remove a stale sheet-scoped named range from a workbook.

PS>


$workbook = Get-OfficeExcel -Path .\Report.xlsx
            $removed = $workbook | Remove-OfficeExcelNamedRange -Sheet Data -Name OldCriteria -PassThru
            Save-OfficeExcel -Document $workbook
        

Uses the thin PowerShell surface over OfficeIMO named-range removal and saves the updated workbook.

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

Remove-OfficeExcelNamedRange [-Global] -Name <String> [-PassThru] [-Save] [<CommonParameters>]
#
Parameter set: Context

Parameters

Global SwitchParameter optionalposition: namedpipeline: False
Use workbook-global scope from inside the DSL.
Name String requiredposition: 0pipeline: False
Named range name.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a result object.
Save SwitchParameter optionalposition: namedpipeline: False
Save the workbook immediately after removing the name.

Outputs

System.Boolean

Remove-OfficeExcelNamedRange -Document <ExcelDocument> -Name <String> [-PassThru] [-Save] [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook document.
Name String requiredposition: 0pipeline: False
Named range name.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a result object.
Save SwitchParameter optionalposition: namedpipeline: False
Save the workbook immediately after removing the name.
Sheet String optionalposition: namedpipeline: False
Worksheet name for a sheet-scoped operation.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Zero-based worksheet index for a sheet-scoped operation.

Outputs

System.Boolean