Click or drag to resize

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.

Namespace:  ExpertXls.ExcelLib
Assembly:  expertxls (in expertxls.dll) Version: 7.0.0
Syntax
public ExcelHyperlink AddHyperlink(
	ExcelHyperlinkType type,
	ExcelRange sourceRange,
	string targetAddress
)

Parameters

type
Type: ExpertXls.ExcelLibExcelHyperlinkType
The URL address to which this hyperlink points.
sourceRange
Type: ExpertXls.ExcelLibExcelRange
The range to which the hyperlink is attached.
targetAddress
Type: SystemString
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

Type: ExcelHyperlink
The newly created hyperlink.
See Also