{"id":46534051,"url":"https://github.com/markuskiller/vba-edit","last_synced_at":"2026-04-03T21:23:52.820Z","repository":{"id":266564788,"uuid":"896040236","full_name":"markuskiller/vba-edit","owner":"markuskiller","description":"Enable seamless vba editing in preferred editor or IDE (facilitating the use of coding assistants and version control workflows)","archived":false,"fork":false,"pushed_at":"2026-03-03T06:29:46.000Z","size":876,"stargazers_count":14,"open_issues_count":8,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-03T10:14:38.894Z","etag":null,"topics":["excel","ms-office","vba","word"],"latest_commit_sha":null,"homepage":"https://langui.ch/current-projects/vba-edit/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markuskiller.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-29T12:27:08.000Z","updated_at":"2026-02-23T15:23:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"55f33c1a-4383-4a53-a981-8dd7857b46b1","html_url":"https://github.com/markuskiller/vba-edit","commit_stats":null,"previous_names":["markuskiller/vba-edit"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/markuskiller/vba-edit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuskiller%2Fvba-edit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuskiller%2Fvba-edit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuskiller%2Fvba-edit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuskiller%2Fvba-edit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markuskiller","download_url":"https://codeload.github.com/markuskiller/vba-edit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markuskiller%2Fvba-edit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30202539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["excel","ms-office","vba","word"],"created_at":"2026-03-06T23:08:21.543Z","updated_at":"2026-04-03T21:23:52.806Z","avatar_url":"https://github.com/markuskiller.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [vba-edit](https://github.com/markuskiller/vba-edit) \n\n**Edit VBA code in VS Code, PyCharm, Wing IDE, or any editor you love.** Real-time sync with MS Office apps (support for **Excel**, **Word**, **PowerPoint** \u0026 **Access**). Git-friendly. No more VBA editor pain.\n\n[![CI](https://github.com/markuskiller/vba-edit/actions/workflows/test.yaml/badge.svg)](https://github.com/markuskiller/vba-edit/actions/workflows/test.yaml)\n[![PyPI - Version](https://img.shields.io/pypi/v/vba-edit.svg)](https://pypi.org/project/vba-edit)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/vba-edit.svg)](https://pypi.org/project/vba-edit)\n[![Platform](https://img.shields.io/badge/platform-windows-blue.svg)](https://pypi.org/search/?q=vba-edit\u0026o=\u0026c=Operating+System+%3A%3A+Microsoft+%3A%3A+Windows)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/vba-edit)](https://www.pypiplus.com/project/vba-edit/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\n## Installation\n\n### RECOMMENDED: Via [``uvx``](https://docs.astral.sh/uv/guides/tools/) (No Install Required)\n```bash\nuvx excel-vba edit -f myfile.xlsm\nuvx word-vba edit -f myfile.docm\nuvx powerpoint-vba edit -f myfile.pptm\nuvx access-vba edit -f myfile.accdb\n```\n\n\u003e **Note:** The ``uvx`` command runs the tool without installing it permanently — same as: ``uv tool run excel-vba``\n\n### Python Package\n```bash\npip install -U vba-edit\n```\n\n### Windows Binaries (No Python Required)\n\nStandalone executables available - no Python installation needed!\n\n📦 **Download**: [Latest Release](https://github.com/markuskiller/vba-edit/releases/latest) (scroll all the way down to **Assets** section)\n\nAvailable binaries:\n- `excel-vba.exe` - For Excel workbooks (.xlsm, .xlsb, .xls)\n- `word-vba.exe` - For Word documents (.docm)\n- `access-vba.exe` - For Access databases (.accdb, .mdb)\n- `powerpoint-vba.exe` - For PowerPoint presentations (.pptm)\n\n🔒 **Security**: See [Security Verification Guide](SECURITY_VERIFICATION.md) for SHA256 checksums and attestation validation.\n\n\u003e ⚠️ **Windows SmartScreen \u0026 VirusTotal Warnings**: Binaries are currently unsigned. You may see warning messages - this is expected. See [Issue #24](https://github.com/markuskiller/vba-edit/issues/24) and [Security Info](SECURITY.md) for details.\n\n## 30-Second Demo\n```bash\n# Start editing (uses active Excel/Word document) — no install required!\nuvx excel-vba edit    # or: uvx word-vba edit\n\n# That's it! Edit the .bas/.cls files in your editor. Save = Sync.\n```\n\n## How It Works\n\u003cpre\u003e\n                        \u003c--- vba-edit ---\u003e\n\nExcel / Word                 COMMANDS              Your favourite\nPowerPoint / Access             v                       Editor\n\n+------------------+                            +------------------+\n|                  |                            |                  |\n|   VBA Project    |   \u003c---   EDIT*   (once -\u003e) |  (e.g. VS CODE)  | \n|                  |                            |                  |     latest\n|  (Office VBA-    |          EXPORT      ---\u003e  |   .bas           |  \u003c- AI coding-  \n|    Editor)       |                            |   .cls           |     assistants\n|                  |   \u003c---   IMPORT            |   .frm           |   \n|                  |                            |  (.frx binary)   | \n|                  |                            |                  | \n+------------------+                            +------------------+\n                                                         v\n                                                +------------------+\n                                                |                  |\n * watches \u0026 syncs                              |    (e.g. Git)    |\n   back to Office                               |  version control |\n   VBA-Editor live                              |                  |\n   on save [CTRL+S]                             |                  |\n                                                +------------------+\n\u003c/pre\u003e\n\n## Why vba-edit?\n\n- **Use YOUR editor** - VS Code, PyCharm, Wing IDE, Sublime, Vim, etc. whatever you love \n- **AI-ready** - Use Copilot, ChatGPT, or any coding assistant \n- **Team-friendly** - Share code via Git, no COM add-ins needed \n- **Real version control** - Diff, merge, and track changes properly \n- **Well-organized** - Keep your VBA structured, clean, and consistent\n\n## Setup (One-Time)\n\n**Windows Only** | **MS Office**\n\nEnable VBA access in Office:\n\n`File → Options → Trust Center → Trust Center Settings → Macro Settings`\n\n✅ **Trust access to the VBA project object model**\n\n\u003e 💡 Can't find it? Run `uvx excel-vba check` (or `excel-vba check` if installed) to verify settings\n\n### VS Code Settings (Recommended)\n\nTo ensure VS Code handles VBA file encoding correctly, add the following to your user settings (`%APPDATA%\\Code\\User\\settings.json`):\n\n```json\n\"[vba]\": {\n    \"files.encoding\": \"windows1252\"\n},\n\"files.associations\": {\n    \"*.bas\": \"vba\",\n    \"*.cls\": \"vba\",\n    \"*.frm\": \"vba\"\n}\n```\n\n\u003e 💡 **Using VS Code Profiles?** Add these settings to each profile's `settings.json` as well.  \n\u003e Change `\"windows1252\"` to match the `--encoding` value you pass to vba-edit if you use a different code page.\n\n\n## Common Workflows\n\n\u003e All workflows below work with both `excel-vba \u003ccommand\u003e` (installed) and `uvx excel-vba \u003ccommand\u003e` (no install required).\n\n### Start Fresh\n```bash\nuvx excel-vba edit                # Start with active workbook — no install required!\nexcel-vba edit                    # If already installed\n```\n\n### Quick Export with Folder View\n```bash\nexcel-vba export --open-folder    # Export and open in File Explorer\nexcel-vba export --keep-open      # Export but keep document open for inspection\nexcel-vba export --no-color       # Export without colorized output\n```\n\n### Team Project with Git\n```bash\nexcel-vba export --vba-directory ./src/vba\ngit add . \u0026\u0026 git commit -m \"Updated reports module\"\n``` \n\n### Support for RubberduckVBA Style (big thank you to @onderhold!)\n```bash\nexcel-vba edit --rubberduck-folders --in-file-headers\n``` \n\n## Quick Reference\n\n### App-specific tools\n\n| CLI Tool | Description |\n|---------|-------------|\n| `excel-vba` | For Excel Workbooks (.xlsm, .xlsb, .xls) |\n| `word-vba` | For Word documents (.docm) |\n| `access-vba` | For Access databases (.accdb, .mdb) |\n| `powerpoint-vba` | For PowerPoint presentations (.pptm) |\n\n\u003e 💡 Use with `uvx excel-vba \u003ccommand\u003e` (no install) or `excel-vba \u003ccommand\u003e` (if installed). Standalone `.exe` binaries also available — see [Latest Release](https://github.com/markuskiller/vba-edit/releases/latest).\n\n\u003e 💡 **Note**: Additional macro-enabled formats (.xltm, .dotm, .potm) are likely supported but not yet tested in this release.\n\n### Commands\n\n| Command overview | Description |\n|---------|-------------|\n| `edit` | Edit VBA content in Office document |\n| `import` | Import VBA content into Office document |\n| `export` | Export VBA content from Office document |\n| `check` | Check if 'Trust Access to the Office VBA project object model' is enabled |\n\n\u003e 💡 Use **`uvx excel-vba \u003ccommand\u003e --help`** (or `excel-vba \u003ccommand\u003e --help` if installed) for a detailed option overview.\n\n### Examples of options\n\n\u003e All examples below work with both `excel-vba \u003ccommand\u003e` (installed) and `uvx excel-vba \u003ccommand\u003e` (no install required).\n\n| Command | What it does |\n|---------|-------------|\n| `excel-vba edit` | Start live editing |\n| `excel-vba export` | One-time export |\n| `excel-vba import` | One-time import |\n| `excel-vba export --open-folder --keep-open` | Export and open folder in explorer, keep document open for inspection |\n| `excel-vba export --force-overwrite` | Export without confirmation prompts |\n| `excel-vba check` | Verify status of *Trust access* to the VBA project object model |\n\n\u003e 💡 **Complete Option Matrix**: available **[here](https://langui.ch/current-projects/vba-edit/#OptionMatrix)**\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| \"Trust access\" error | Run `uvx excel-vba check` (or `excel-vba check`) for diagnostics |\n| Changes not syncing | Save the file in your editor |\n| Forms not working | Add `--in-file-headers` flag |\n\n\n## Safety Features\n\n**🛡️ Data Loss Prevention**\n\nvba-edit now protects your work with smart safety checks:\n\n- **Overwrite Protection**: Warns before overwriting existing VBA files\n- **Header Mode Detection**: Alerts when switching between header storage modes\n- **Orphaned File Cleanup**: Automatically removes stale `.header` files on mode change\n- **UserForm Validation**: Prevents exports without proper header handling\n\n**Bypass for Automation**: Use `--force-overwrite` flag to skip prompts in CI/CD pipelines:\n```bash\nexcel-vba export --vba-directory ./src --force-overwrite\n```\n\n\u003e ⚠️ **CAUTION**: `--force-overwrite` suppresses all safety prompts. Use with caution!\n\n\n## Features\n\n**🚀 Core**\n- Live sync between Office and your editor\n- Full Git/version control support\n- All Office apps: Excel, Word, Access \u0026 PowerPoint\n\n**📁 Organization** \n- RubberduckVBA folder structure support\n- Smart file organization with `@Folder` annotations\n- TOML config files for team standards\n\n**🔧 Advanced**\n- Unicode \u0026 encoding support\n- UserForms with layout preservation  \n- Class modules with custom attributes\n\n\n## Roadmap\n\nDevelopment priorities evolve based on user feedback and real-world needs. \n\n👀 **See active planning**: [GitHub Milestones](https://github.com/markuskiller/vba-edit/milestones)  \n💡 **Request features**: [Open an Issue](https://github.com/markuskiller/vba-edit/issues)  \n📝 **Current focus**: v0.5.0 - Reference management\n\n\n### 💡 Feedback \u0026 Contributions\n\nFound a bug? Have a feature idea? Questions about usage? Open an [Issue](https://github.com/markuskiller/vba-edit/issues) - we use labels to organize different types of feedback.\n\n---\n\n## Command Line Tools\n\n\u003e 💡 **Complete CLI Overview**: available **[here](https://langui.ch/current-projects/vba-edit/#CLI)**\n\n### Example of `--in-file-headers --rubberduck-folders`\n\n```vba\nVERSION 1.0 CLASS\nBEGIN\n  MultiUse = -1  'True\nEND\nAttribute VB_Name = \"MyClass\"\nAttribute VB_GlobalNameSpace = False\nAttribute VB_Creatable = False\nAttribute VB_PredeclaredId = False\nAttribute VB_Exposed = False\n\n'@Folder(\"Business.Domain\")\nPublic Sub DoSomething()\n    ' Your code here\nEnd Sub\n```\n\n## Colorized Output\n\nTerminal output features color-coded messages terms for better readability:\n\n- ✓ **Success** messages in green\n- ✗ **Error** messages in red\n- ⚠ **Warning** messages in yellow\n- **Technical terms** (VBA, TOML, JSON) highlighted in cyan\n- **Code examples** shown in dim gray\n\n**Automatic Behavior:**\n- Colors automatically disabled when output is piped or redirected\n- Disabled in non-TTY environments (CI/CD pipelines)\n- Respects `NO_COLOR` environment variable\n\n**Manual Control:**\n```bash\nexcel-vba export --no-color              # Disable colors\nexport NO_COLOR=1; excel-vba export      # Via environment variable\n```\n\n\u003e 💡 **Tip**: Use `--no-color` when terminal colors cause issues.\n\n## Configuration Files\n\nUse TOML configuration files to standardize team workflows and avoid repetitive command-line arguments.\n\n### Basic Configuration\n\nCreate a `vba-config.toml` file in your project:\n\n```toml\n[general]\nfile = \"MyWorkbook.xlsm\"\nvba_directory = \"src/vba\"\nverbose = true\nrubberduck_folders = true\nin_file_headers = true\n```\n\nThen use it:\n```bash\nexcel-vba export --conf vba-config.toml\n```\n\n### Available Configuration Keys\n\n**[general] section:**\n- `file` - Path to Office document\n- `vba_directory` - Directory for VBA files\n- `encoding` - Character encoding (e.g., \"utf-8\", \"cp1252\")\n- `verbose` - Enable verbose logging (true/false)\n- `logfile` - Path to log file\n- `rubberduck_folders` - Use RubberduckVBA @Folder annotations (true/false)\n- `save_headers` - Save headers to separate .header files (true/false)\n- `in_file_headers` - Embed headers in code files (true/false)\n- `open_folder` - Open export directory after export (true/false)\n- `keep_open` - Keep document open after export (true/false)\n- `no_color` - Disable colorized terminal output (true/false)\n\n**Other sections (reserved for future use):**\n- `[office]` - Office-wide settings\n- `[excel]` - Excel-specific settings\n- `[word]` - Word-specific settings\n- `[access]` - Access-specific settings\n- `[powerpoint]` - PowerPoint-specific settings\n\n### Configuration Placeholders\n\nConfiguration values support dynamic placeholders for flexible path management.\n\n**Available placeholders**\n- `{config.path}` - Directory containing the config file\n- `{file.name}` - Document filename without extension\n- `{file.fullname}` - Document filename with extension\n- `{file.path}` - Directory containing the document\n- `{file.vbaproject}` - VBA project name (resolved at runtime)\n\n**Legacy placeholders (deprecated in v0.4.1, removed in v0.5.0):**\n- `{general.file.name}` → use `{file.name}`\n- `{general.file.fullname}` → use `{file.fullname}`\n- `{general.file.path}` → use `{file.path}`\n- `{vbaproject}` → use `{file.vbaproject}`\n\n**Example with placeholders:**\n\n```toml\n[general]\nfile = \"C:/Projects/MyApp/MyWorkbook.xlsm\"\nvba_directory = \"{file.path}/{file.name}-vba\"\n# This resolves to: C:/Projects/MyApp/MyWorkbook-vba\n```\n\n**Relative paths example:**\n\n```toml\n[general]\nfile = \"../documents/report.xlsm\"\nvba_directory = \"{config.path}/vba-modules\"\n# vba_directory is relative to config file location\n```\n\n### Command-Line Override\n\nCommand-line arguments always override config file settings, including boolean flags:\n\n```bash\n# Config says vba_directory = \"src/vba\"\n# This overrides it to \"build/vba\"\nexcel-vba export --conf vba-config.toml --vba-directory build/vba\n\n# Config says in_file_headers = true\n# This overrides it to save-headers mode\nexcel-vba export --conf vba-config.toml --save-headers\n```\n\n\u003e ⚠️ **CAUTION**: **1.** Always **backup your Office files** before using `vba-edit` **2.** Use **version control (git)** to track your VBA code **3.** Run `export` after changing **form layouts** or module properties\n\n\n### Known Limitations\n\n- UserForms require `--save-headers` or newer `--in-file-headers` option (`edit` process is aborted if this is not the case)\n- If separate `*.header` files are modified on their own, the corresponding `*.cls`, `*.bas` or `*.frm` file needs to be saved in order to sync the complete module back into the VBA project model\n\n## Links\n\n- [Homepage](https://langui.ch/current-projects/vba-edit/)\n- [Documentation](https://github.com/markuskiller/vba-edit/blob/main/README.md)\n- [Source Code](https://github.com/markuskiller/vba-edit)\n- [Changelog](https://github.com/markuskiller/vba-edit/blob/main/CHANGELOG.md)\n- [Changelog of latest dev version](https://github.com/markuskiller/vba-edit/blob/dev/CHANGELOG.md)\n- [Video Tutorial](https://www.youtube.com/watch?v=xoO-Fx0fTpM) (xlwings walkthrough, with similar functionality)\n\n## License\n\nBSD 3-Clause License\n\n## Credits\n\n**vba-edit** builds on an excellent idea first implemented for Excel in [xlwings](https://www.xlwings.org/) (BSD-3).\n\nSpecial thanks to **@onderhold** for improved header handling, RubberduckVBA folder and config file support in v0.4.0, and unified CLI handling across all Office tools in v0.4.3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkuskiller%2Fvba-edit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkuskiller%2Fvba-edit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkuskiller%2Fvba-edit/lists"}