This release adds 3 notable features for engineering teams evaluating rollout.
✓ No known CVEs patched in this version
Topics
+13 more
ReleasePort's take
Moderate signalVersion v1.1.1 fixes silent loss of document module bindings in ExcelFile.set_module() and adds several VBA‑module editing features, while introducing a breaking change for add_module(kind=other).
Why it matters: Fixes prevent data loss; the breaking change requires an explicit attribute header when adding non‑standard modules (severity 70), so code using kind=other must be updated before upgrade.
Summary
AI summaryFixed silent loss of attribute headers when editing document module source via set_module().
Changes in this release
| Type | Severity | Summary | CVE |
|---|---|---|---|
| Breaking | High |
`add_module(kind=other)` now requires an explicit attribute header; automatic synthesis is disabled. `add_module(kind=other)` now requires an explicit attribute header; automatic synthesis is disabled. Source: llm_adapter@2026-05-27 Confidence: high |
— |
| Feature | Low |
Adds support for VBE-style body‑only source edits in set_module(). Adds support for VBE-style body‑only source edits in set_module(). Source: llm_adapter@2026-05-27 Confidence: high |
— |
| Feature | Low |
Introduces `VBAModule.body` property for reading/writing a module's executable body. Introduces `VBAModule.body` property for reading/writing a module's executable body. Source: llm_adapter@2026-05-27 Confidence: high |
— |
| Feature | Low |
Adds `VBAModule.attribute_header` field capturing the module's attribute header. Adds `VBAModule.attribute_header` field capturing the module's attribute header. Source: llm_adapter@2026-05-27 Confidence: high |
— |
| Feature | Low |
Provides public helper `split_attribute_header(source) -> (header, body)`. Provides public helper `split_attribute_header(source) -> (header, body)`. Source: llm_adapter@2026-05-27 Confidence: high |
— |
| Feature | Low |
`add_module(name, body, kind=standard)` now synthesizes a minimal `Attribute VB_Name` header when none is supplied. `add_module(name, body, kind=standard)` now synthesizes a minimal `Attribute VB_Name` header when none is supplied. Source: llm_adapter@2026-05-27 Confidence: high |
— |
| Feature | Low |
`rename_module()` updates the in‑source `Attribute VB_Name` line to reflect the new logical name. `rename_module()` updates the in‑source `Attribute VB_Name` line to reflect the new logical name. Source: llm_adapter@2026-05-27 Confidence: high |
— |
| Feature | Low |
Adds `TestAttributeHeaderPreservation` test class covering header splitting, body‑only preservation, header synthesis, and rejection of missing headers for kind=other. Adds `TestAttributeHeaderPreservation` test class covering header splitting, body‑only preservation, header synthesis, and rejection of missing headers for kind=other. Source: llm_adapter@2026-05-27 Confidence: high |
— |
| Bugfix | Medium |
Fixes silent loss of document module bindings when editing via set_module(). Fixes silent loss of document module bindings when editing via set_module(). Source: llm_adapter@2026-05-27 Confidence: high |
— |
Full changelog
Fixed
- Editing a document module's source via
set_module()(e.g.ThisWorkbook,
Sheet1) silently broke the workbook in Excel. The leading
Attribute VB_Name = "ThisWorkbook"/Attribute VB_Base = "..."/
Attribute VB_PredeclaredId = Trueheader lines that bind a document
module to its host object were being stripped on a source replacement.
Excel then re-compiled the module without those bindings and either
silently dropped the code or showed an empty module in the VBE.
Added
- VBE-style body-only source edits.
ExcelFile.set_module(name, text)
now accepts either a full source replacement (text beginning with
Attribute VB_*orVERSION ... CLASS) or a bare body. When a bare
body is supplied, the module's existing attribute header is
automatically re-prepended, matching the VBE UX where the user only
types the executable code. VBAModule.bodyproperty: read or write a module's executable body
without touching its attribute header.VBAModule.attribute_headerfield: the contiguous leading
VERSION ... CLASSblock +Attribute VB_*lines + separator,
captured at parse time.split_attribute_header(source) -> (header, body)public helper.add_module(name, body, kind=standard)now synthesizes a minimal
Attribute VB_Name = "<name>"header when the caller doesn't supply
one. Caller-supplied headers are passed through unchanged.add_module(kind=other)requires an explicit attribute header.
pyOpenVBA refuses to invent class or document module headers since
their host-binding metadata can't be safely guessed.rename_module()re-keys the in-sourceAttribute VB_Name = "..."
line to the new logical name so the source matches the dir-stream
binding.- New
TestAttributeHeaderPreservationtest class covering:
header splitting (standard, document, class, headerless),
set_modulebody-only preservation on a document module,
set_modulefull-source replacement,
add_moduleheader synthesis vs. caller-supplied,
add_module(kind=other)rejection without a header,
and theVBAModule.bodyproperty round-trip.
Weekly OSS security release digest.
The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.
No spam, unsubscribe anytime.
Share this release
About WilliamSmithEdward/pyOpenVBA
All releases →Related context
Related tools
Beta — feedback welcome: [email protected]