Cmdlet
Remove-OfficeExcelNamedRange
Removes a workbook or sheet-scoped Excel named range.
Syntax
Examples
Remove a stale sheet-scoped named range from a workbook.
$workbook = Get-OfficeExcel -Path .\Report.xlsx
$removed = $workbook | Remove-OfficeExcelNamedRange -Sheet Data -Name OldCriteria -PassThru
Save-OfficeExcel -Document $workbookUses the thin PowerShell surface over OfficeIMO named-range removal and saves the updated workbook.
Parameters
- -Global SwitchParameter
- Use workbook-global scope from inside the DSL.
- -Name String
- Named range name.
- -PassThru SwitchParameter
- Emit a result object.
- -Save SwitchParameter
- Save the workbook immediately after removing the name.
- -Document ExcelDocument
- Workbook document.
- -Sheet String
- Worksheet name for a sheet-scoped operation.
- -SheetIndex Int32
- 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.