Skip to main content

vba

Read, change, debug and install VBA for Word, Excel and PowerPoint, from the command line or an MCP client.

  • Reads and writes the macros inside Office files with pyOpenVBA. No Office needed.
  • On a Mac, loads changed code into the running app without a restart and runs it on one file.
  • Installs finished code in your macro file: backed up, checked, and only while the app is closed.

What works where

Mac Windows Linux
list, pull, install Yes Yes, but not yet tried on a real PC Same, with --file
load, run, exec, unload, status Yes No No
Default macro files Found Looked for in %APPDATA%\Microsoft None
mcp All tools vba_help, vba_list, vba_pull vba_help, vba_list, vba_pull

Live control uses AppleScript. Windows would need a version for COM, which is not written. Until then, on Windows: test a change in the VBA editor, then install it with the app closed.

Run

uvx vba --help                        # needs only uv
uvx --from /path/to/vba vba --help    # from a checkout

vba --help is the reference for commands, defaults and limits.

MCP

{
    "command": "uvx",
    "args": ["vba", "mcp"]
}

The server runs VBA in your open Office apps, so a client can do whatever VBA can. It has no install, and Excel files are always copied first.

How live loading works

Dev add-in Loaded by
Word VBADev.dotm in the Word startup folder AppleScript add addin
Excel VBADev.xlam in the Add-Ins folder A loader add-in in the Excel startup folder
PowerPoint VBADev.ppam in the Add-Ins folder AppleScript register add in

An app reads an add-in only when it loads it, so each update is unload, replace, load. run and exec add a caller to the code that checks the target file, catches errors and returns a function's value.

Limits

  • Code that does not compile, or a MsgBox, opens a dialog that you must answer. Until then the tool sends the app nothing, because Excel quits on a command sent during a dialog.
  • An endless loop blocks the app.
  • A macro acts on the active file. The target is checked just before it runs.
  • Undo: Word and PowerPoint only. Files a macro writes or deletes cannot be undone.
  • No breakpoints or stepping; use the VBA editor for those.

Test

PYTHONDONTWRITEBYTECODE=1 uv run --no-project --with-editable . --with pytest pytest -p no:cacheprovider

License

AGPL-3.0-or-later

Metadata

Release files for vba 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vba 0.1.0
File Size Uploaded Provenance Actions
vba-0.1.0.tar.gz 38.6 kB Without provenance Details for vba-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vba 0.1.0
File Interpreter ABI Platform Actions
vba-0.1.0-py3-none-any.whl Python 3 none any Details for vba-0.1.0-py3-none-any.whl

Total release size: 74.9 kB

Release files / vba-0.1.0.tar.gz

Download URL vba-0.1.0.tar.gz
Size 38.6 kB
Tags Source
SHA-256 checksum
How to use checksums
17c3f37abaaeeacbd571a9d1db2f2c42409e522135afbe7f16ec3bf63fe524ff
BLAKE2b-256 checksum
How to use checksums
df4f7d7830a122c39a40d3fd913a3cdd3b2e685284e15c0f5bd49e8882513e9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / vba-0.1.0-py3-none-any.whl

Download URL vba-0.1.0-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92ebaee7753e5d8a041433197f5a942bdaf4f9d7c2b34ea86adea4ceda917424
BLAKE2b-256 checksum
How to use checksums
154b299c27c56126f90c279fec6de9d296df5d7e40d3443fc59a29e6c7ba0ceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for vba 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page