Cmdlet
Get-OfficeExcelNamedRange
Gets defined names from a workbook.
Syntax
Get-OfficeExcelNamedRange
[-Document <ExcelDocument>]
[-Name <String>]
[-Sheet <OfficeSheetSelector>]
[<CommonParameters>]#Parameter set:
DocumentGet-OfficeExcelNamedRange
[-Name <String>]
[-Path] <String[]>
[-Sheet <OfficeSheetSelector>]
[<CommonParameters>]#Parameter set:
PathGet-OfficeExcelNamedRange
-LiteralPath <String[]>
[-Name <String>]
[-Sheet <OfficeSheetSelector>]
[<CommonParameters>]#Parameter set:
LiteralPathGet-OfficeExcelNamedRange
[-AllowHttp]
[-Name <String>]
[-Sheet <OfficeSheetSelector>]
[-Uri] <Uri>
[<CommonParameters>]#Parameter set:
UriExamples
List defined names
Get-OfficeExcelNamedRange -Path .\Finance\Pricing-Model.xlsxShows every defined name and what it refers to.
Find broken names
Get-OfficeExcelNamedRange -Path .\Finance\Budget-2027.xlsx |
Where-Object Reference -like '*#REF!*' |
Select-Object Name, SheetName, ReferenceLists the defined names that refer to #REF! after sheets were deleted, so they can be repaired or removed.
Parameters
- -Document ExcelDocument
- Caller-owned workbook; omission uses the enclosing Excel content block.
- -Name String
- Optional named range to retrieve.
- -Sheet OfficeSheetSelector
- Worksheet name, one-based position or native worksheet object. Multi-sheet commands also accept wildcard names.
- -Path String[]
- Workbook paths resolved with filesystem wildcard support.
- -LiteralPath String[]
- Literal workbook paths, including FileInfo.FullName and provider PSPath.
- -AllowHttp SwitchParameter
- Allow HTTP workbook downloads in addition to HTTPS.
- -Uri Uri
- Remote workbook URI to inspect.
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.