Workbook.VBProject Property (2007 System)
Gets the virtual Microsoft.Vbe.Interop.VBProject project that is in the workbook.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property VBProject As VBProject
'Usage
Dim instance As Workbook
Dim value As VBProject
value = instance.VBProject
[BrowsableAttribute(false)]
public VBProject VBProject { get; }
[BrowsableAttribute(false)]
public:
property VBProject^ VBProject {
VBProject^ get ();
}
public function get VBProject () : VBProject
Property Value
Type: 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.