ExpertXls Excel Library for .NET
AddHyperlink Method (type, sourceRange, targetAddress)
Namespaces ► ExpertXls.ExcelLib ► ExcelHyperlinksCollection ► AddHyperlink(ExcelHyperlinkType, ExcelRange, String)
ExpertXls Excel Library for .NET
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.
Declaration Syntax

C# | Visual Basic | Visual C++

    public ExcelHyperlink AddHyperlink(
    	ExcelHyperlinkType type,
    	ExcelRange sourceRange,
    	string targetAddress
    )

    Public Function AddHyperlink ( _
    	type As ExcelHyperlinkType, _
    	sourceRange As ExcelRange, _
    	targetAddress As String _
    ) As ExcelHyperlink

    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
The newly created hyperlink.

Assembly: ExpertXls.ExcelLib (Module: ExpertXls.ExcelLib) Version: 2.1.0.0 (2.1.0.0)