Hyperlinks.Add Method
Adds a hyperlink to the specified range or shape. Returns a Hyperlink object.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
Function Add ( _
Anchor As Object, _
Address As String, _
SubAddress As Object, _
ScreenTip As Object, _
TextToDisplay As Object _
) As Object
'Usage
Dim instance As Hyperlinks
Dim Anchor As Object
Dim Address As String
Dim SubAddress As Object
Dim ScreenTip As Object
Dim TextToDisplay As Object
Dim returnValue As Object
returnValue = instance.Add(Anchor, Address, _
SubAddress, ScreenTip, TextToDisplay)
Object Add(
Object Anchor,
string Address,
Object SubAddress,
Object ScreenTip,
Object TextToDisplay
)
Parameters
Anchor
Type: System.ObjectRequired Object. The anchor for the hyperlink. Can be either a Range or Shape object.
Address
Type: System.StringRequired String. The address of the hyperlink.
SubAddress
Type: System.ObjectOptional Object. The subaddress of the hyperlink.
ScreenTip
Type: System.ObjectOptional Object. The screen tip to be displayed when the mouse pointer is paused over the hyperlink.
TextToDisplay
Type: System.ObjectOptional Object. The text to be displayed for the hyperlink.
Return Value
Type: System.Object
Remarks
When you specify the TextToDisplay argument, the text must be a string.