Condividi tramite


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)

Syntax

'Declaration
Public ReadOnly Property VBProject As VBProject
public VBProject VBProject { get; }

Property Value

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

Remarks

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

Examples

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 Sub DisplayVBProject()
    MsgBox("The name of the VB project is: " & _
        Me.VBProject.Name)
End Sub
private void DisplayVBProject()
{
    MessageBox.Show("The name of the VB project is: " + this.VBProject.Name);
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace