3.1.6 PROJECT Stream Example

Office

This example illustrates the properties of the VBA project in the Project Stream.

Offset

Size

Structure

Value

00000000

027F

array of bytes - text

ID="{917DED54-440B-4FD1-A5C1-74ACF261E600}"\r\nDocument=ThisWorkbook/&H00000000\r\nDocument=Sheet1/&H00000000\r\nPackage={AC9F2F90-E877-11CE-9F68-00AA00574A4F}\r\nBaseClass=UserForm1\r\nHelpFile="c:\example path\example.hlp"\r\nName="VBAProject"\r\nHelpContextID="1"\r\nDescription="Example VBA Project Description"\r\nVersionCompatible32="393222000"\r\nCMG="0705D8E3D8EDDBF1DBF1DBF1DBF1"\r\nDPB="0E0CD1ECDFF4E7F5E7F5E7"\r\nGC="1517CAF1D6F9D7F9D706"\r\n\r\n[Host Extender Info]\r\n&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000\r\n\r\n[Workspace]\r\nThisWorkbook=23, 23, 911, 280, \r\nSheet1=69, 69, 724, 317, C\r\nUserForm1=0, 0, 0, 0, C, 46, 46, 701, 294, Z

Figure 12: Project stream

The preceding table illustrates an array of bytes that contains the example VBAPROJECTText (section 2.3.1). The VBAPROJECTText (section 2.3.1) conforms to the ABNF syntax.

text: The example VBAPROJECTText (section 2.3.1) follows. The following text is formatted for readability:

 ID="{917DED54-440B-4FD1-A5C1-74ACF261E600}"
 Document=ThisWorkbook/&H00000000
 Document=Sheet1/&H00000000
 Package={AC9F2F90-E877-11CE-9F68-00AA00574A4F}
 BaseClass=UserForm1
 HelpFile="c:\example path\example.hlp"
 Name="VBAProject"
 HelpContextID="1"
 Description="Example VBA Project Description"
 VersionCompatible32="393222000"
 CMG="0705D8E3D8EDDBF1DBF1DBF1DBF1"
 DPB="0E0CD1ECDFF4E7F5E7F5E7"
 GC="1517CAF1D6F9D7F9D706"
  
 [Host Extender Info]
 &H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000
  
 [Workspace]
 ThisWorkbook=23, 23, 911, 280, 
 Sheet1=69, 69, 724, 317, C
 UserForm1=0, 0, 0, 0, C, 46, 46, 701, 294, Z

ProjectID (section 2.3.1.2): "ID="{917DED54-440B-4FD1-A5C1-74ACF261E600}"" specifies the CLSID of the VBA project’s Automation type library.

ProjectDocModule (section 2.3.1.4): specifies the module names, "ThisWorkbook" and "Sheet1", of the document modules in the VBA project. "&H00000000" specifies the modules are document modules. This example contains no ProjectStdModule (section 2.3.1.5) or ProjectClassModule (section 2.3.1.6) properties as there are no procedural modules or class modules.

ProjectPackage (section 2.3.1.8): "Package={AC9F2F90-E877-11CE-9F68-00AA00574A4F}" specifies the CLSID for the designer module, "UserForm1", as specified in the ProjectDesignerModule (section 2.3.1.7) property.

ProjectHelpFile (section 2.3.1.9): "HelpFile="c:\example path\example.hlp"" is equivalent to the value specified in PROJECTHELPFILEPATH (section 2.3.4.2.1.7) field in the PROJECTINFORMATION record (section 2.3.4.2.1).

ProjectName (section 2.3.1.11): "Name="VBAProject"" is equivalent to the value specified in PROJECTNAME (section 2.3.4.2.1.5).

ProjectHelpId (section 2.3.1.12): "HelpContextID="1"" is equivalent to the value specified in PROJECTHELPCONTEXT (section 2.3.4.2.1.8).

ProjectDescription (section 2.3.1.13): "Description="Example VBA Project Description"" is equivalent to the DocStringRecord (section 2.3.4.2.1.6) field in the PROJECTINFORMATION record (section 2.3.4.2.1).

ProjectVersionCompat2.3.1.14 (section 2.3.1.14): "VersionCompatible32="393222000"" specifies the VBA version of the VBA project.

ProjectProtectionState (section 2.3.1.15): "CMG="0705D8E3D8EDDBF1DBF1DBF1DBF1"" specifies no sources are restricted access to the VBA project. The value is obfuscated by Data Encryption (section 2.4.3). The following is the decrypted value of the ProjectProtectionState (section 2.3.1.15) as specified by an Encrypted Data Structure (section 2.4.3.1). The text is formatted for readability:

 Seed:           0x07
 Version:        0x02
 ProjKey:        0xDF
 Ignored:        0x070707
 DataLength:     0x00000004
 Data:           0x00000000

ProjectPassword (section 2.3.1.16): "DPB="0E0CD1ECDFF4E7F5E7F5E7"" specifies the VBA project has no password. The value is obfuscated by Data Encryption (section 2.4.3). The following is the decrypted value of the ProjectProtectionState (section 2.3.1.15) as specified by an Encrypted Data Structure (section 2.4.3.1). The text is formatted for readability:

 Seed:           0x0E
 Version:        0x02
 ProjKey:        0xDF
 Ignored:        0x070707
 DataLength:     0x00000001
 Data:           0x00

ProjectVisibilityState (section 2.3.1.17): "GC="1517CAF1D6F9D7F9D706"" specifies the VBA project is visible. The value is obfuscated by Data Encryption (section 2.4.3). The following text is the decrypted value of ProjectVisibilityState (section 2.3.1.17) as specified by an Encrypted Data Structure (section 2.4.3.1). The text is formatted for readability:

 Seed:           0x15
 Version:        0x02
 ProjKey:        0xDF
 Ignored:        0x0707
 DataLength:     0x00000001
 Data:           0xFF

HostExtenderRef (section 2.3.1.18): "&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000", specifies the list of host extenders. There is only one host extender for the VBA project.

ExtenderIndex: "&H00000001" specifies the host extender entry is "1".

ExtenderGuid: "{3832D640-CF90-11CF-8E43-00A0C911005A}" specifies the GUID of the Automation type library to extend.

LibName: "VBE" specifies a built in name for the VBA Automation type library.

CreationFlags: "&H00000000" specifies that a new extended type library for the aggregatable server cannot be created if there is one available.

ProjectWorkspace record (section 2.3.1.19) specifies module window states for the three modules in the VBA project.

The first ProjectWorkspace record (section 2.3.1.19) specifies the module window state for the "ThisWorkbook" module. The ModuleIdentifier value, "ThisWorkbook" specifies the name of the module. The first CodeWindow value, "23, 23, 911, 280", specifies the coordinates of the window as follows:

WindowLeft 23

WindowTop 23

WindowRight 911

WindowBottom 280

There is no value for WindowState for this module.

The second ProjectWorkspace record (section 2.3.1.19) specifies the module window state for the "Sheet1" module. ModuleIdentifier "Sheet1" specifies the name of the module. The CodeWindow Value, "69, 69, 724, 317" specifies the coordinates of the window as follows:

WindowLeft = 69

WindowTop = 69

WindowRight = 724

WindowBottom = 317

The WindowState, "C" specifies the code window for this module is closed.

The third ProjectWorkspace record (section 2.3.1.19) specifies the module windows state for the "UserForm1" designer module. ModuleIdentifier "UserForm1" specifies the name of the module. The CodeWindow value, "0, 0, 0, 0", specifies no code window coordinates for this ProjectWorkspace record (section 2.3.1.19). The WindowState, "C", specifies the code window for this module is closed. The DesignerWindow value, "46, 46, 701, 294", specifies the coordinates of the window as follows:

WindowLeft = 46

WindowTop = 46

WindowRight = 701

WindowBottom = 294

WindowState: "Z" specifies the DesignerWindow is zoomed to fill the available viewing area.

Show: