Aracılığıyla paylaş


XmlMappedRange.Name Özellik

Tanımlı bir ad için gösteren bir değeri alır veya ayarlar bir XmlMappedRange Denetim.

Ad alanı:  Microsoft.Office.Tools.Excel
Derleme:  Microsoft.Office.Tools.Excel (Microsoft.Office.Tools.Excel.dll içinde)

Sözdizimi

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

Özellik Değeri

Tür: System.Object
A Microsoft.Office.Interop.Excel.Name için tanımlı bir adı temsil eden bir nesne bir XmlMappedRange Denetim.

Örnekler

Aşağıdaki kod örneği ekler bir Microsoft.Office.Interop.Excel.Name tarafından kaplanan hücreye başvuran bir XmlMappedRange için geçerli bir çalışma. Sonra bu örnek kullanır Name o şimdi adını görüntülemek için özellik başvurduğu XmlMappedRange. Bu kod örneği, geçerli çalışma sayfasının içerdiğini varsayar bir XmlMappedRange adlı 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);
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

XmlMappedRange Arabirim

Microsoft.Office.Tools.Excel Ad Alanı