Share via


XmlMappedRange.Parent 屬性

取得 Microsoft.Office.Interop.Excel.Worksheet,表示包含 XmlMappedRange 控制項的工作表。

命名空間:  Microsoft.Office.Tools.Excel
組件:  Microsoft.Office.Tools.Excel (在 Microsoft.Office.Tools.Excel.dll 中)

語法

'宣告
ReadOnly Property Parent As Object
Object Parent { get; }

屬性值

型別:System.Object
Microsoft.Office.Interop.Excel.Worksheet ,表示包含 XmlMappedRange 控制項的工作表。

範例

下列程式碼範例使用 Parent 屬性來顯示 XmlMappedRange 的父 Microsoft.Office.Interop.Excel.Worksheet 名稱。 這個程式碼範例假設目前工作表包含名為 CustomerLastNameCell 的 XmlMappedRange

Private Sub DisplayParentName()
    Dim sheet1 As Excel.Worksheet = _
        CType(Me.CustomerLastNameCell.Parent, Excel.Worksheet)
    MsgBox("The XmlMappedRange is in worksheet: " & sheet1.Name)
End Sub
private void DisplayParentName()
{
    Excel.Worksheet sheet1 = (Excel.Worksheet)this.CustomerLastNameCell.Parent;
    MessageBox.Show("The XmlMappedRange is in worksheet: " + sheet1.Name);
}

.NET Framework 安全性

請參閱

參考

XmlMappedRange 介面

Microsoft.Office.Tools.Excel 命名空間