SetSubAddress
Sets the subaddress of the target document.
Syntax
expression.SetSubAddress(sSubAddress);
expression - A variable that represents an ApiHyperlink class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| sSubAddress | Required | string | The subaddress in "Sheet1!A1" format. |
Returns
This method doesn't return any data.
Example
Set a new subaddress for a hyperlink.
// Useful for changing the internal location of an existing hyperlink in a cell.
// Set a new subaddress for a hyperlink.
let worksheet = Api.GetActiveSheet();
worksheet.SetHyperlink("A1", "", "Sheet1!B5", "Go to B5", "Internal link");
let hyperlink = worksheet.GetHyperlinks()[0];
hyperlink.SetSubAddress("Sheet1!D10");
worksheet.GetRange("A3").SetValue("New subaddress: " + hyperlink.GetSubAddress());