Skip to main content

GetAddress

Returns the range address.

Syntax

expression.GetAddress(RowAbs, ColAbs, RefStyle, External, RelativeTo);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
RowAbsRequiredbooleanDefines if the link to the row is absolute or not.
ColAbsRequiredbooleanDefines if the link to the column is absolute or not.
RefStyleRequiredstringThe reference style.
ExternalRequiredbooleanDefines if the range is in the current file or not.
RelativeToRequiredrangeThe range which the current range is relative to.

Returns

string | null

Example

This example shows how to get the range address.

var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetValue("1");
oWorksheet.GetRange("B1").SetValue("2");
var sAddress = oWorksheet.GetRange("A1").GetAddress(true, true, "xlA1", false);
oWorksheet.GetRange("A3").SetValue("Address: ");
oWorksheet.GetRange("B3").SetValue(sAddress);