Hyperlink class

Encapsulates the object that represents a hyperlink.

The Hyperlink type exposes the following members:

Properties

PropertyDescription
addressRepresents the address of a hyperlink.
text_to_displayRepresents the text to be displayed for the specified hyperlink. The default value is the address of the hyperlink.
areaGets the range of hyperlink.
screen_tipReturns or sets the ScreenTip text for the specified hyperlink.
link_typeGets the link type.

Methods

MethodDescription
deleteDeletes this hyperlink

Example

from aspose.cells import Workbook

# Instantiating a Workbook object
workbook = Workbook()
# Adding a new worksheet to the Workbook object
workbook.worksheets.add()
# Obtaining the reference of the newly added worksheet by passing its sheet index
worksheet = workbook.worksheets[0]
# Adding a hyperlink to a URL at "A1" cell
index = worksheet.hyperlinks.add("A1", 1, 1, "http://www.aspose.com")
# Getting a Hyperlink by index.
hyperlink = worksheet.hyperlinks[index]
# Setting display text of this hyperlink.
hyperlink.text_to_display = "Aspose"
# Saving the Excel file
workbook.save("book1.xls")

See Also