Existing XLSB module source edits
Qualified editing profile
The XLSX Workbook facade can save pending source edits to an existing standard module in a represented unsigned VBA project as XLSB, reopen the result and keep the exact edited source together with unrelated cell edits
Use the existing ParsedVBAProject module collection and its SourceCode property, then save explicitly with xlsxExcelBinaryWorkbook; module lookup is one-based and selects an existing module that the original project declared, subject to the standard, document or Class profile described here
This extends the stable unsigned project profile; retaining an unchanged project and editing a parsed module stay separate capabilities
| Operation | Admitted behaviour |
|---|---|
| Source edit | Change the source of an existing standard module whilst retaining its original name, stream, source offset and identity attributes |
| Encoding | The complete edited source must encode and decode exactly through the project's declared code page |
| Project ownership | The parsed project and backing storage must belong to the current Workbook, and the original storage must still match the retained raw project streams |
| Document identities | Keep supported Workbook and ordinary worksheet CodeNames; admitted source edits leave their original declaration and identity attributes untouched |
| Binary lifecycle | Save and normally reopen edited XLSB, repeat binary saving, save ordinary macro-enabled Open XML and afterwards save XLSB again |
The real source witness carries one standard module, one Workbook document module and one worksheet document module spread over two worksheets, one worksheet CodeName being empty; the qualified Windows editing path opens from a caller stream and lets that source go ahead of saving
Workbook and ordinary worksheet document sources
Existing code has been qualified independently for editing the original Workbook and ordinary worksheet document modules at the same time, within the represented unsigned project
The real source keeps ThisWorkbook and Sheet1 as document identities across two worksheets, the other worksheet's CodeName being empty; a standard module that was never edited stays byte-exact
Edit only SourceCode on the owned existing modules, and keep every original Attribute line, stream and source offset; supported CodeNames and their original project bindings have to stay consistent
The finite witness adds different non-event functions to both document sources and holds them through repeated checked binary saves, refused identity changes followed by healthy retry, ordinary macro-enabled XML and released-stream reopening
Qualification clears 80 public checks with no new library compilation and 35 real native checks in an independently owned invisible Excel process; macros, events and link updates stay switched off, VBOM is never touched and no persistent security change is made, and normal Quit and input hashes are verified
Independent decompression runs 11126 checks over the source and eight saved projects, proving the edited document text exact and the standard text untouched, with original source offsets and performance prefixes, unchanged project/directory streams and the seven-byte invalidated cache header
A further 1380 structural and source checks bind the actual graph and outputs; four repeated-package comparisons hold every member exactly apart from the specifically located Root Entry modification FILETIME in the VBA compound container, which differs
Native source persistence establishes nothing about VBA syntax, compilation, macro execution, arbitrary class modules or chart-document support; those stay separate profiles
Existing unsigned Class sources
The represented Windows source editor is also qualified for an existing Class module that the original unsigned project declared, with its original module name, source stream, source offset and every identity Attribute retained
The witness takes an entire original ten-module project byte-for-byte into an explicitly derived minimal host, then repeats the public editing lifecycle from the actual Excel-saved binary host; the host construction claims no native authorship
The finite edit appends a non-event function to one existing Class source and leaves the other nine modules as they are; 140 public checks cover repeated checked binary saving, macro-enabled XML, released streams, observational previews and refused identity or Attribute changes followed by a successful retry
Actual Excel opens the host and both edited formats read-only with macros, events and link updates switched off, saves independent copies and reopens them; 70 native checks pass with a normal owned-process exit, unchanged inputs, no VBOM access and no persistent trust changes
Independent decompression of 17 library and native outputs proves the target source exact, the remaining modules unchanged, the original directory and project declarations, source offsets and performance prefixes intact; only the edited Class stream and the required seven-byte invalidation header change
Eight same-phase complete-package comparisons hold every member body apart from a specifically located Root Entry modification FILETIME where it differs; the minimal host picks up extra style records during the ordinary XML bridge, so cross-phase package identity is not claimed
This qualification establishes source persistence rather than VBA syntax, compilation or execution; new or renamed modules, changed Attributes, chart documents, signed projects and other unqualified project profiles keep their separate boundaries
Preview and publication
GetConversionReport(xlsConversionExcelBinaryWorkbook) inspects the pending edit without applying it to the live project, replacing its raw bytes, clearing dirty source or altering the Workbook view generation
Binary saving uses an operation-local detached project snapshot and validates the captured raw project, parsed-project owner, module names and source text, document identities and backing storage before it publishes the staged output
A supported binary save leaves the live original raw project and pending source edit available, so repeated binary saving remains possible; ordinary Open XML saving keeps its existing synchronisation behaviour
Changed source or foreign storage introduced by a writing callback rejects stale publication; cancellation preserves the caller destination and cursor, and the supported pending edit can be saved again following the refused operation
Nested saves on the same Workbook or another Workbook use separate local contexts; this is a synchronous save contract and establishes no concurrent thread safety
Persisted project contents
Only admitted edited modules' compressed source suffixes and the required _VBA_PROJECT invalidation stream may change in the detached VBA project; the original module prefix, directory, project declarations, other streams and unedited module source stay bound to their originals
The project cache uses the existing seven-byte _VBA_PROJECT version-FFFF invalidation form; preserving an original module performance prefix does not certify that the cached compiled code remains usable
Native validation opens and saves the represented files normally with macros disabled, then independently decompresses the persisted module source; this qualifies source persistence and document identities without executing or compiling the macro
Finite limits
The detached snapshot retains the existing bounds of 256 parsed modules, 4096 storage nodes, 64 storage levels, 4 MiB per admitted stream, 4194304 UTF-16 code units per module, 4 MiB encoded source per edited module, 8 MiB aggregate storage, 8 MiB aggregate pending encoded source and 16 MiB aggregate pending UTF-16 source; the serialised project must also fit the binary profile's 8 MiB project limit
These are admission limits, not a whole-process memory ceiling; the original project, detached storage and serialised project may coexist during inspection and saving
Remaining boundaries
Raw project replacement, module creation or renaming, unqualified class-module or chart-document profiles, changed identity attributes, unsupported or changed CodeNames, signed projects, package-signature origins and unknown project relationships stay outside this profile
Projects carrying the explicit local binary UDF declaration profile also allow unsigned module SourceCode editing when saving to xlsxExcelBinaryWorkbook, keeping both the detached edited VBA module streams and the binary UDF identity across HotXLS saves whilst non-binary export refusals stay in place; note that resaving an invalidated _VBA_PROJECT cache in Excel with macros disabled keeps the edited VBA streams and worksheet formulas whilst wiping uncompiled binary procedure flags until macros are switched back on
Parsed source editing is qualified on Windows; the unchanged raw-project retention path does not imply a portable parsed editor, a fresh compiler matrix, macro trust validation or automatic VBA execution
Broader XLSB drawings, connections, PivotTable, Slicer, Timeline and extension handling keep their individual backend requirements