Sdílet prostřednictvím


XmlMappedRange.Name – vlastnost

Získá nebo nastaví hodnotu představující definovaný název XmlMappedRange řízení.

Obor názvů:  Microsoft.Office.Tools.Excel
Sestavení:  Microsoft.Office.Tools.Excel (v Microsoft.Office.Tools.Excel.dll)

Syntaxe

'Deklarace
Property Name As Object
    Get
    Set
Object Name { get; set; }

Hodnota vlastnosti

Typ: System.Object
A Microsoft.Office.Interop.Excel.Name objekt představující definovaný název XmlMappedRange řízení.

Příklady

Následující příklad kódu přidá Microsoft.Office.Interop.Excel.Name odkazuje buňka obsazené XmlMappedRange aktuálního list. Příklad poté používá Name vlastnost zobrazíte název dané nyní odkazuje XmlMappedRange. Tento kód příklad předpokládá, že obsahuje aktuální list XmlMappedRange s názvem CustomerLastNameCell.

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
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, missing];
    location = location.Insert(0, "=");

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

    // Get the Name of the XmlMappedRange and display the name.
    Excel.Name name2 = ((Excel.Name)this.CustomerLastNameCell.Name);
    MessageBox.Show(name2.Name);
}

Zabezpečení rozhraní .NET Framework

Viz také

Odkaz

XmlMappedRange Rozhraní

Microsoft.Office.Tools.Excel – obor názvů