Skip to content

This release adds 3 notable features for engineering teams evaluating rollout.

✓ No known CVEs patched
Read the diff → Tool health → What is this tool? →

✓ No known CVEs patched in this version

Topics

compound-file deterministic excel file-format macro-extraction ms-cfb
+13 more
ms-ovba office-automation openxml pure-python python roundtrip vba vba-macros xlam xls xlsb xlsm zero-dependencies

ReleasePort's take

Moderate signal
editorial:auto 8d

Version 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 summary

Fixed silent loss of attribute headers when editing document module source via set_module().

Changes in this release

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 = True header 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_* or VERSION ... 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.body property: read or write a module's executable body
    without touching its attribute header.
  • VBAModule.attribute_header field: the contiguous leading
    VERSION ... CLASS block + 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-source Attribute VB_Name = "..."
    line
    to the new logical name so the source matches the dir-stream
    binding.
  • New TestAttributeHeaderPreservation test class covering:
    header splitting (standard, document, class, headerless),
    set_module body-only preservation on a document module,
    set_module full-source replacement,
    add_module header synthesis vs. caller-supplied,
    add_module(kind=other) rejection without a header,
    and the VBAModule.body property 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

Track WilliamSmithEdward/pyOpenVBA

Get notified when new releases ship.

Sign up free

About WilliamSmithEdward/pyOpenVBA

All releases →

Related context

Earlier breaking changes

  • v3.0.0 Renamed the `AccessFile` class to `AccessReader`.
  • v3.0.0 Renamed `pyopenvba.access` module to `pyopenvba.access_read`.

Beta — feedback welcome: [email protected]