ExcelHyperlinksCollectionAddHyperlink Method

Adds a new hyperlink of the specified type to the hyperlinks collection of a worksheet. The hyperlink is attached to the specified source range and poins to the specified target address. The target address can be a URL, a file or folder in the file system or a range adress from a worksheet function of the hyperlink type.

Definition

Namespace: Winnovative.ExcelLib
Assembly: WnvXls_NetCore (in WnvXls_NetCore.dll) Version: 11.0.0
C#
public ExcelHyperlink AddHyperlink(
	ExcelHyperlinkType type,
	ExcelRange sourceRange,
	string targetAddress
)

Parameters

type  ExcelHyperlinkType
The URL address to which this hyperlink points.
sourceRange  ExcelRange
The range to which the hyperlink is attached.
targetAddress  String
The target address to which this hyperlink points. The target address can be a URL (e.g. 'http://www.mysite.com' or 'maito://support@mysite.com'), a file or folder in the file system (e.g. 'file://C:\MyFolder' or 'file://C:\MyFolder\MyFile.txt' or file://\\MyServer\MyFolder) or a range adress from the same worksheet or another worksheet (e.g. 'MySheet!A1' or 'A1:B2' ) function of the hyperlink type. When the address is a range address, the name of the range cannot contain white spaces. You can define a named range if the target worksheet name contains spaces.

Return Value

ExcelHyperlink
The newly created hyperlink.

See Also