NativeExcel for .Net Developer's Reference

IRange.Address Method

Returns the range reference.

Overload List

Returns the local range reference.

[Visual Basic] Function Address() As String
[C#] string Address();
[C++] String* Address();
[JScript] function Address(): String;

Returns the range reference.

[Visual Basic] Function Address(ByVal Boolean) As String
[C#] string Address(bool);
[C++] String* Address(bool);
[JScript] function Address(bool): String;

Returns the range reference.

[Visual Basic] Function Address(ByVal Boolean,ByVal Boolean,ByVal Boolean) As String
[C#] string Address(bool,bool,bool);
[C++] String* Address(bool,bool,bool);
[JScript] function Address(bool,bool,bool): String;

Example

This example gets range reference for the used range.

[C#]
  string ref = book.Worksheets[1].UsedRange.Address();
[Visual Basic]
  Dim ref As String = book.Worksheets(1).UsedRange.Address()
[C++]
String^ ref = book->Worksheets->Item[1]->UsedRange->Address();
This example demostrates the Address method capabilities
[C#]
IRange r = book.Worksheets[1].Range["A2:B4"];
Console.WriteLine(r.Address());
Console.WriteLine(r.Address(true));
Console.WriteLine(r.Address(false, false, true));
Output:
$A$2:$B$4
'Sheet1'!$A$2:$B$4
A2:B4

See Also

IRange Interface | NativeExcel Namespace