vba-edit

Enable seamless MS Office VBA code editing in preferred editor or IDE (facilitating the use of coding assistants and version control workflows)

CI PyPI - Version PyPI - Python Version PyPI - Downloads License

Links

Quickstart

Installation

To install vba-edit, you can use pip:

pip install vba-edit

or uv pip:

uv pip install vba-edit

Overview command-line tools

vba-edit v0.2.1 (word-vba|excel-vba|...)

A command-line tool suite for managing VBA content in MS Office documents.

WORD|EXCEL|...-VBA allows you to edit, import, and export VBA content 
from Office documents. If no file is specified, the tool will attempt
to use the currently active document.

         usage: word-vba [-h] {edit,import,export} ...
         usage: excel-vba [-h] {edit,import,export} ...
         usage: access-vba [-h] {edit,import,export} ...      {planned in v0.3.0}
         usage: powerpoint-vba [-h] {edit,import,export} ...  {planned in v0.4.0}   

Commands:
    edit    Edit VBA content in Office document
    import  Import VBA content into Office document
    export  Export VBA content from Office document

Examples :                          
    word-vba  edit   <--- uses active Word document and current directory for exported 
                          VBA files (*.bas/*.cls/*.frm) & syncs changes back to the 
                          active Word document
    

    Options:

    word-vba  import -f "C:/path/to/document.docx" --vba-directory "path/to/vba/files"
    word-vba  export --file "C:/path/to/document.docx" --encoding cp850 --save-metadata
    word-vba  edit --vba-directory "path/to/vba/files" --logfile "path/to/logfile" --verbose

positional arguments:
  {edit,import,export}
    edit                Edit VBA content in Office document
    import              Import VBA content into Office document
    export              Export VBA content from Office document

options:
  -h, --help            Show this help message and exit