Project

PSWriteOffice

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

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Set-OfficeExcelHyperlink

Aliases: ExcelHyperlink
Module
PSWriteOffice
Aliases
ExcelHyperlink
Inputs
OfficeIMO.Excel.ExcelDocument

Sets a hyperlink on a worksheet cell.

Syntax

Examples

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 optional
A1-style cell address (e.g., A1, C5).
-Column Int32 optional
1-based column index.
-Display String optional
Optional display text.
-NoStyle SwitchParameter optional
Skip hyperlink styling (blue + underline).
-PassThru SwitchParameter optional
Emit the worksheet after setting the link.
-Row Int32 optional
1-based row index.
-Url String requiredsets: ContextExternal, DocumentExternal
External URL to link to.
-Document ExcelDocument requiredpipeline: True (ByValue)sets: DocumentExternal, DocumentInternal
Workbook to operate on outside the DSL context.
-Sheet String optionalsets: DocumentExternal, DocumentInternal
Worksheet name when using Document.
-SheetIndex Int32 optionalsets: DocumentExternal, DocumentInternal
Worksheet index (0-based) when using Document.
-Location String optionalsets: DocumentInternal, ContextInternal
Internal location to link to (e.g., "'Summary'!A1").
-TargetAddress String optionalsets: DocumentInternal, ContextInternal
Target A1 address for internal links.
-TargetSheet String optionalsets: DocumentInternal, ContextInternal
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.