WorkbookBase.Parent Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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