Udostępnij za pośrednictwem


Workbook.Parent Property (2007 System)

Gets the parent object for the workbook.

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 Parent As Object
'Usage
Dim instance As Workbook 
Dim value As Object 

value = instance.Parent
[BrowsableAttribute(false)]
public Object Parent { get; }
[BrowsableAttribute(false)]
public:
property Object^ Parent {
    Object^ get ();
}
public function get Parent () : Object

Property Value

Type: System.Object
The parent object for the workbook.

Examples

The following code example uses the Parent property to display the name of the parent of the current workbook.

This example is for a document-level customization.

Private Sub DisplayParentName()
    Dim parentObject As Excel.Application = _
        CType(Me.Parent, Excel.Application)
    MsgBox("The parent of the current workbook is: " & _
        parentObject.Name)
End Sub
private void DisplayParentName()
{
    Excel.Application parentObject = (Excel.Application)this.Parent;
    MessageBox.Show("The parent of the current workbook is: " +
        parentObject.Name);
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace