Compartilhar via


WorkbookBase.Parent Property

Definition

Gets the parent object for the workbook.

public:
 property System::Object ^ Parent { System::Object ^ get(); };
public object Parent { get; }
member this.Parent : obj
Public ReadOnly Property Parent As Object

Property Value

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 void DisplayParentName()
{
    Excel.Application parentObject = (Excel.Application)this.Parent;
    MessageBox.Show("The parent of the current workbook is: " +
        parentObject.Name);
}
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

Applies to