Compartilhar via


WorksheetBase.Hyperlinks Property

Gets a Microsoft.Office.Interop.Excel.Hyperlinks collection that represents the hyperlinks for the range or worksheet.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property Hyperlinks As Hyperlinks
public Hyperlinks Hyperlinks { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.Hyperlinks
A Microsoft.Office.Interop.Excel.Hyperlinks collection that represents the hyperlinks for the range or worksheet.

Examples

The following code example uses the Hyperlinks property to add a hyperlink to the Microsoft.Office.Interop.Excel.Hyperlinks collection of the worksheet.

This example is for a document-level customization.

Private Sub AddHyperLink()
    Dim link As Excel.Hyperlink = _
        CType(Me.Hyperlinks.Add(Me.Range("A1"), _
        "https://www.microsoft.com", ScreenTip:="Microsoft", _
        TextToDisplay:="Microsoft"), Excel.Hyperlink)
End Sub
private void AddHyperLink()
{
    Excel.Hyperlink link = (Excel.Hyperlink)this.Hyperlinks.Add(
        this.Range["A1"], "https://www.microsoft.com", "Microsoft", "Microsoft");
}

.NET Framework Security

See Also

Reference

WorksheetBase Class

Microsoft.Office.Tools.Excel Namespace