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 retain 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 declared by the original project, 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 remain separate capabilities
| Operation | Admitted behavior |
|---|---|
| Source edit | Change the source of an existing standard module while retaining its original name, stream, source offset and identity attributes |
| Encoding | The full 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 its retained raw project streams |
| Document identities | Retain supported Workbook and ordinary worksheet CodeNames; admitted source edits preserve their original declaration and identity attributes |
| Binary lifecycle | Save and normally reopen edited XLSB, repeat binary saving, save ordinary macro-enabled Open XML and subsequently save XLSB again |
The actual source witness has one standard module, one Workbook document module and one worksheet document module across two worksheets, with one worksheet CodeName empty; the qualified Windows editing path opens from a caller stream and releases that source before saving
Workbook and ordinary worksheet document sources
Existing code is independently qualified for simultaneous source edits to the original Workbook and ordinary worksheet document modules in the represented unsigned project
The actual source retains ThisWorkbook and Sheet1 as document identities across two worksheets, with the other worksheet CodeName empty; an unedited standard module remains exact
Edit only SourceCode on the owned existing modules, preserving every original Attribute line, stream and source offset; supported CodeNames and their original project bindings must remain consistent
The finite witness adds distinct non-event functions to both document sources and retains them through repeated checked binary saves, refused identity changes followed by healthy retry, ordinary macro-enabled XML and released-stream reopening
Qualification passes 80 public checks with zero new library compilation and 35 actual native checks in an independently owned invisible Excel process; macros, events and link updates stay disabled, no VBOM access or persistent security change is used, and normal Quit and input hashes are verified
Independent decompression performs 11126 checks across the source and eight saved projects, proving exact edited document text and untouched standard text, original source offsets and performance prefixes, unchanged project/directory streams and the seven-byte invalidated cache header
An additional 1380 structural and source checks bind the actual graph and outputs; four repeated-package comparisons retain every member exactly except the specifically located Root Entry modification FILETIME in the VBA compound container where it differs
Native source persistence does not establish VBA syntax, compilation, macro execution, arbitrary class modules or chart-document support; those remain separate profiles
Existing unsigned Class sources
The represented Windows source editor is also qualified for an existing Class module declared by the original unsigned project, with its original module name, source stream, source offset and every identity Attribute retained
The witness retains an entire original ten-module project byte-for-byte inside an explicitly derived minimal host, then repeats the public editing lifecycle from the actual Excel-saved binary host; the host construction does not claim native authorship
The finite edit appends a non-event function to one existing Class source and leaves the other nine modules unchanged; 140 public checks cover repeated checked binary saving, macro-enabled XML, released streams, observational previews and refused identity or Attribute changes followed by successful retry
Actual Excel opens the host and both edited formats read-only with macros, events and link updates disabled, saves independent copies and reopens them; 70 native checks pass with normal owned-process exit, unchanged inputs and no VBOM access or persistent trust changes
Independent decompression of 17 library and native outputs proves exact target source, unchanged remaining modules, original directory and project declarations, source offsets and performance prefixes; only the edited Class stream and required seven-byte invalidation header change
Eight same-phase complete-package comparisons retain all member bodies except a specifically located Root Entry modification FILETIME where it differs; the minimal host gains additional 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 retain 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 changing 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 publishing 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 synchronization behavior
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 after the refused operation
Nested saves on the same Workbook or another Workbook use separate local contexts; this is a synchronous save contract and does not establish 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 remain 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 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 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 serialized 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 serialized 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 remain outside this profile
Projects carrying the explicit local binary UDF declaration profile also support unsigned module SourceCode editing when saving to xlsxExcelBinaryWorkbook, preserving both the detached edited VBA module streams and the binary UDF identity across HotXLS saves while retaining non-binary export refusals; note that resaving an invalidated _VBA_PROJECT cache in Excel with macros disabled preserves the edited VBA streams and worksheet formulas while clearing uncompiled binary procedure flags until macros are enabled
Parsed source editing is qualified on Windows; the unchanged raw-project retention path does not imply a portable parsed editor, a new compiler matrix, macro trust validation or automatic VBA execution
Broader XLSB drawings, connections, PivotTable, Slicer, Timeline and extension handling retain their individual backend requirements