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

Publish

bash publish.sh --help

License

AGPL-3.0-or-later

Metadata

Release files for vba 0.1.1

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.1
File Size Uploaded Provenance Actions
vba-0.1.1.tar.gz 42.8 kB Without provenance Details for vba-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 79.1 kB

Release files / vba-0.1.1.tar.gz

Download URL vba-0.1.1.tar.gz
Size 42.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c91f2ceed9c9355d57472297005ddbcbbd4483bb4ea2b9ead4f4b6c4ced6202f
BLAKE2b-256 checksum
How to use checksums
2a3902203f1751c0f400331f4ad07aa62f701ef4f138fde644a9548faefcb606
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.1-py3-none-any.whl

Download URL vba-0.1.1-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58a8f9e7fab78ef6ff6196fe6bca2dbaa6b9ea9684357bbf52d98450e643e9ad
BLAKE2b-256 checksum
How to use checksums
32ea5cdde3c3cf1d62e28d2d26e2369aa7d43862acd3a2bac324ed1a2e47fde0
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.1

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