Range.AddHyperlink

Adds a hyperlink to a specified cell or a range of cells.

public Hyperlink AddHyperlink(string address, string textToDisplay, string screenTip)
ParameterTypeDescription
addressStringAddress of the hyperlink.
textToDisplayStringThe text to be displayed for the specified hyperlink.
screenTipStringThe screenTip text for the specified hyperlink.

Return Value

Hyperlink object.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class RangeMethodAddHyperlinkWithStringStringStringDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Worksheet sheet = workbook.Worksheets[0];
            Aspose.Cells.Range range = sheet.Cells.CreateRange("A1:A5");
            
            // Add hyperlink with address, text to display and screen tip
            range.AddHyperlink("https://www.aspose.com", "Visit Aspose", "Click to go to Aspose website");
            
            // Save the workbook
            workbook.Save("HyperlinkDemo.xlsx");
        }
    }
}

See Also