Cmdlet
Set-OfficeExcelHyperlink
Sets a hyperlink on a worksheet cell.
Syntax
Set-OfficeExcelHyperlink
[-Address <String>]
[-Column <Int32>]
[-Display <String>]
[-NoStyle]
[-PassThru]
[-Row <Int32>]
-Url <String>
[<CommonParameters>]#Parameter set:
ContextExternalSet-OfficeExcelHyperlink
[-Address <String>]
[-Column <Int32>]
[-Display <String>]
-Document <ExcelDocument>
[-NoStyle]
[-PassThru]
[-Row <Int32>]
[-Sheet <String>]
[-SheetIndex <Int32>]
-Url <String>
[<CommonParameters>]#Parameter set:
DocumentExternalSet-OfficeExcelHyperlink
[-Address <String>]
[-Column <Int32>]
[-Display <String>]
-Document <ExcelDocument>
[-Location <String>]
[-NoStyle]
[-PassThru]
[-Row <Int32>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-TargetAddress <String>]
[-TargetSheet <String>]
[<CommonParameters>]#Parameter set:
DocumentInternalSet-OfficeExcelHyperlink
[-Address <String>]
[-Column <Int32>]
[-Display <String>]
[-Location <String>]
[-NoStyle]
[-PassThru]
[-Row <Int32>]
[-TargetAddress <String>]
[-TargetSheet <String>]
[<CommonParameters>]#Parameter set:
ContextInternalExamples
Set an external hyperlink.
ExcelSheet 'Data' { Set-OfficeExcelHyperlink -Address 'A1' -Url 'https://example.org' -Display 'Example' }Creates a styled hyperlink in A1.
Set an internal hyperlink.
ExcelSheet 'Data' { Set-OfficeExcelHyperlink -Row 2 -Column 1 -TargetSheet 'Summary' -TargetAddress 'A1' -Display 'Go to Summary' }Links A2 to Summary!A1.
Parameters
- -Address String
- A1-style cell address (e.g., A1, C5).
- -Column Int32
- 1-based column index.
- -Display String
- Optional display text.
- -NoStyle SwitchParameter
- Skip hyperlink styling (blue + underline).
- -PassThru SwitchParameter
- Emit the worksheet after setting the link.
- -Row Int32
- 1-based row index.
- -Url String
- External URL to link to.
- -Document ExcelDocument
- Workbook to operate on outside the DSL context.
- -Sheet String
- Worksheet name when using Document.
- -SheetIndex Int32
- Worksheet index (0-based) when using Document.
- -Location String
- Internal location to link to (e.g., "'Summary'!A1").
- -TargetAddress String
- Target A1 address for internal links.
- -TargetSheet String
- Target worksheet name for internal links.
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.