Share via


XmlMappedRange.Address Property (2007 System)

Gets the range reference of the XmlMappedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Address As XmlMappedRange._AddressType
'Usage
Dim instance As XmlMappedRange 
Dim value As XmlMappedRange._AddressType 

value = instance.Address
[BrowsableAttribute(false)]
public XmlMappedRange._AddressType Address { get; }
[BrowsableAttribute(false)]
public:
property XmlMappedRange._AddressType^ Address {
    XmlMappedRange._AddressType^ get ();
}
public function get Address () : XmlMappedRange._AddressType

Property Value

Type: Microsoft.Office.Tools.Excel.XmlMappedRange._AddressType
A string that represents the range reference of the XmlMappedRange control in R1C1-style or A1-style notation.

Remarks

The Address property is intended to be used with the following parameters.

Parameter

Description

RowAbsolute

true to return the row as an absolute reference; otherwise, false. The default value is true.

ColumnAbsolute

true to return the column as an absolute reference; otherwise, false. The default value is true.

ReferenceStyle

One of the XlReferenceStyle values.

External

true to return an external reference; false to return a local reference. The default value is false.

RelativeTo

A Range that defines the starting point. If RowAbsolute and ColumnAbsolute are false, and ReferenceStyle is xlR1C1, you must include a starting point for the relative reference.

If you attempt to use Address without specifying any parameters, Address will get an XmlMappedRange._AddressType object that is part of the Visual Studio Tools for Office infrastructure and is not intended to be used directly from your code.

Optional Parameters

For information on optional parameters, see The Variable missing and Optional Parameters in Office Solutions.

Examples

The following code example uses the Address property to display the range location of an XmlMappedRange. The example uses different combinations of the ReferenceStyle, RowAbsolute, ColumnAbsolute and RelativeTo parameters to display the range location in four different formats. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell. If CustomerLastNameCell is at cell A2, the example will display the address strings "$A$2", "$A2", "R2C2", and "R[-1]C[-1]".

Private Sub DisplayAddress()
    Me.Range("A1").Value2 = _
        Me.CustomerLastNameCell.Address(True, True, _
        Excel.XlReferenceStyle.xlA1, False)

    Me.Range("A2").Value2 = _
        Me.CustomerLastNameCell.Address(False, True, _
        Excel.XlReferenceStyle.xlA1, False)

    Me.Range("A3").Value2 = _
        Me.CustomerLastNameCell.Address(True, True, _
        Excel.XlReferenceStyle.xlR1C1, False)

    Me.Range("A4").Value2 = _
        Me.CustomerLastNameCell.Address(False, False, _
        Excel.XlReferenceStyle.xlR1C1, False, Me.Cells(3, 3))
End Sub
private void DisplayAddress()
{
    this.Range["A1", missing].Value2 = 
        this.CustomerLastNameCell.Address[true, true,
        Excel.XlReferenceStyle.xlA1, false, missing];

    this.Range["A2", missing].Value2 = 
        this.CustomerLastNameCell.Address[false, true,
        Excel.XlReferenceStyle.xlA1, false, missing];

    this.Range["A3", missing].Value2 = 
        this.CustomerLastNameCell.Address[true, true,
        Excel.XlReferenceStyle.xlR1C1, false, missing];

    this.Range["A4", missing].Value2 = 
        this.CustomerLastNameCell.Address[false, false,
        Excel.XlReferenceStyle.xlR1C1, false, this.Cells[3, 3]];
}

.NET Framework Security

See Also

Reference

XmlMappedRange Class

XmlMappedRange Members

Microsoft.Office.Tools.Excel Namespace