pub struct VbaProject {
pub project_id: String,
pub modules: Vec<VbaModule>,
pub raw_donor: Vec<u8>,
pub seed_prefix_bytes: Vec<u8>,
pub seed_module_cookie: u16,
pub protection_lines: Option<String>,
}Expand description
VBA project for a workbook
Fields§
§project_id: StringProject ID GUID, e.g. "{7B4E3A2C-1F5D-4A6B-9C8E-2D3F4A5B6C7D}".
modules: Vec<VbaModule>The project’s modules, in no particular order
raw_donor: Vec<u8>The full original vbaProject.bin bytes this project was imported
from vba_synth::synthetic_raw_donor()’s from-scratch bytes – export’s
patch base. See vba_xlsx.rs.
seed_prefix_bytes: Vec<u8>P-code prefix bytes to donate to the first module (weird vibe-coded workaround in order to create a valid module).
Same donation scheme as seed_prefix_bytes
protection_lines: Option<String>See [vba_xlsx::build_project_stream] for why these must be preserved
rather than dropped.
Implementations§
Source§impl VbaProject
impl VbaProject
Sourcepub fn find_module(&self, name: &str) -> Option<&VbaModule>
pub fn find_module(&self, name: &str) -> Option<&VbaModule>
Finds a module by name, matched case-insensitively
Sourcepub fn find_module_mut(&mut self, name: &str) -> Option<&mut VbaModule>
pub fn find_module_mut(&mut self, name: &str) -> Option<&mut VbaModule>
VbaProject::find_module, mutably.
Sourcepub fn module_name_taken(&self, name: &str) -> bool
pub fn module_name_taken(&self, name: &str) -> bool
Whether a module of this name already exists, matched case-insensitively.
Sourcepub fn check_modules(&self) -> Vec<(String, Result<ModuleSyntax, Error>)>
pub fn check_modules(&self) -> Vec<(String, Result<ModuleSyntax, Error>)>
Checks every module, resolving names against the whole project
Sourcepub fn check_modules_partial(
&self,
) -> Vec<(String, Result<ModuleSyntax, Error>)>
pub fn check_modules_partial( &self, ) -> Vec<(String, Result<ModuleSyntax, Error>)>
check_modules for a project that may contain
other modules