XlsHyperLink module
- class XlsHyperLink.XlsHyperLink
Bases:
XlsObject,IHyperLink,ICloneParentRepresents a hyperlink in an Excel worksheet.
This class provides properties and methods for manipulating hyperlinks in Excel, including address, text display, screen tip, and range settings. It extends XlsObject and implements the IHyperLink and ICloneParent interfaces.
- property Address: str
Gets or sets the URL or path of the hyperlink.
- Returns:
The URL or path of the hyperlink.
- Return type:
str
- Clone(parent: SpireObject) SpireObject
Creates a new object that is a copy of the current instance.
- Parameters:
parent – Parent object for a copy of this instance.
- Returns:
A new object that is a copy of this instance.
- property FirstColumn: int
Gets the first column of the range containing the hyperlink.
- Returns:
The zero-based index of the first column.
- Return type:
int
- property FirstRow: int
Gets the first row of the range containing the hyperlink.
- Returns:
The zero-based index of the first row.
- Return type:
int
- property LastColumn: int
Gets the last column of the range containing the hyperlink.
- Returns:
The zero-based index of the last column.
- Return type:
int
- property LastRow: int
Gets the last row of the range containing the hyperlink.
- Returns:
The zero-based index of the last row.
- Return type:
int
- property Name: str
Gets the name of the hyperlink.
- Returns:
The name of the hyperlink.
- Return type:
str
- property Range: IXLSRange
Gets or sets the range that contains the hyperlink.
- Returns:
The range that contains the hyperlink.
- Return type:
IXLSRange
- property ScreenTip: str
Gets or sets the screen tip text for the hyperlink.
- Returns:
The screen tip text for the hyperlink.
- Return type:
str
- SetAddress(strAddress: str, bSetText: bool)
Sets the address of the hyperlink and optionally updates the display text.
- Parameters:
strAddress (str) – The URL or path of the hyperlink.
bSetText (bool) – True to update the display text to match the address; otherwise, False.
- SetSubAddress(strSubAddress: str)
Sets the sub-address of the hyperlink.
- Parameters:
strSubAddress (str) – The sub-address of the hyperlink.
- property SubAddress: str
Gets or sets the sub-address of the hyperlink.
The sub-address is typically used to link to a specific location within a document, such as a named range, bookmark, or cell reference.
- Returns:
The sub-address of the hyperlink.
- Return type:
str
- property TextToDisplay: str
Gets or sets the text to be displayed for the hyperlink.
The default value is the address of the hyperlink.
- Returns:
The text to be displayed for the hyperlink.
- Return type:
str
- property Type: HyperLinkType
Gets or sets the type of the hyperlink.
- Returns:
An enumeration value representing the type of the hyperlink.
- Return type:
HyperLinkType
- property UnicodePath: str
Gets or sets the Unicode file path for the hyperlink.
This property is only valid when the Type property is HyperLinkType.File.
- Returns:
The Unicode file path for the hyperlink.
- Return type:
str
