Export (0) Print
Expand All
Expand Minimize

WorkbookBase.VBProject Property

Gets the virtual Microsoft.Vbe.Interop.VBProject project that is in the workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

public VBProject VBProject { get; }

Property Value

Type: Microsoft.Vbe.Interop.VBProject
The virtual Microsoft.Vbe.Interop.VBProject project that is in the workbook.

This property refers to the Visual Basic for Applications project, not the Visual Basic project.

The following code example uses the VBProject property to display the name of the Visual Basic for Applications project for the workbook.

This example is for a document-level customization.

private void DisplayVBProject()
{
    MessageBox.Show("The name of the VB project is: " + this.VBProject.Name);
}

Show:
© 2014 Microsoft