XmlMappedRange.Name Свойство

Определение

Возвращает или задает значение, представляющее определенное имя для элемента управления XmlMappedRange.

public object Name { get; set; }

Значение свойства

Object

Объект Name, который представляет определенное имя для элемента управления XmlMappedRange.

Примеры

В следующем примере кода добавляется объект Microsoft.Office.Interop.Excel.Name , который ссылается на ячейку, занятую объектом, XmlMappedRange на текущий лист. Затем в примере используется Name свойство для вывода имени, которое теперь ссылается на XmlMappedRange . В этом примере кода предполагается, что текущий лист содержит XmlMappedRange имя CustomerLastNameCell .

private void DisplayName()
{
    // Get the location of the XmlMappedRange and prefix it with a "=".
    string location = this.CustomerLastNameCell.Address[true, true,
        Excel.XlReferenceStyle.xlA1, false];
    location = location.Insert(0, "=");

    // Add a name at the location of the XmlMappedRange.
    this.Names.Add("LastName", location);

    // Get the Name of the XmlMappedRange and display the name.
    Excel.Name name2 = ((Excel.Name)this.CustomerLastNameCell.Name);
    MessageBox.Show(name2.Name);
}
Private Sub DisplayName()
    ' Get the location of the XmlMappedRange and prefix it with a "=".
    Dim location As String = Me.CustomerLastNameCell.Address( _
        True, True, Excel.XlReferenceStyle.xlA1, False)
    location = location.Insert(0, "=")

    ' Add a name at the location of the XmlMappedRange.
    Me.Names.Add("LastName", location)

    ' Get the Name of the XmlMappedRange and display the name.
    Dim name2 As Excel.Name = CType(Me.CustomerLastNameCell.Name, Excel.Name)
    MsgBox("The name of CustomerLastNameCell is: " & name2.Name)
End Sub

Применяется к