Export (0) Print
Expand All
Expand Minimize

Workbook.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 (in microsoft.office.tools.excel.dll)

public virtual VBProject VBProject { get; }

Property Value

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.

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

Show:
© 2014 Microsoft