pub struct VbaModule {
pub name: String,
pub kind: VbaModuleKind,
pub source: String,
pub bound_sheet_id: Option<u64>,
pub prefix_bytes: Vec<u8>,
pub module_cookie: u16,
pub cached_compressed_source: Option<Vec<u8>>,
}Expand description
A single VBA module’s editable content plus the opaque bytes needed to keep Excel happy on export.
Fields§
§name: StringVB_Name – must satisfy validate_vba_module_name
kind: VbaModuleKindWhat kind of module this is
source: StringPlain VBA source text
bound_sheet_id: Option<u64>Required iff kind == Document
prefix_bytes: Vec<u8>Opaque bytes forming the pre-TextOffset “p-code prefix” of this module’s stream. Has nothing to do with the actual content of the module
The module stream’s MODULECOOKIE record (0x002C) value. MS-OVBA
documents this as implementation-specific and ignorable on read.
Preserved here so an imported module’s original value survives re-export.
cached_compressed_source: Option<Vec<u8>>This module stream’s already-compressed source, as read back
verbatim from an imported file. Is None (empty cache) for a freshly
created module.
Implementations§
Source§impl VbaModule
impl VbaModule
Sourcepub fn check_syntax(&self) -> Result<ModuleSyntax, Error>
pub fn check_syntax(&self) -> Result<ModuleSyntax, Error>
Checks this module’s source, naming it in any error