Skip to content

Build Automation & CI/CD Integration

You manage multiple VBA Padlock projects and want to automate the build process. Since version 2026.2, VBA Padlock compiles in-process; there is no separate console compiler. Automation goes through the built-in MCP server: a local endpoint that exposes VBA Padlock’s operations (open project, build DLLs, package a distribution) as callable tools, and a silent mode that runs the Studio without showing its window.

What you’ll learn:

  • How the MCP server exposes build operations
  • How to run VBA Padlock headless for automation
  • How to structure projects for version control
  • How to verify build artifacts

Time needed: 15 minutes


Open AI Settings (Protect tab → Advanced group) to manage the MCP server. Once running, any MCP-capable client (Claude Code, Claude Desktop, or your own MCP client) can drive VBA Padlock with these tools:

AreaTools
Projectopen_office_file, close_project, save_project, get_project_info, list_recent_projects, list_office_files
Buildbuild_dll (platforms: ["Win32"], ["Win64"], or both), check_syntax, get_compilation_errors
Codeget_vba_code, set_vba_code, create_module, delete_module
Settingsget_project_settings, set_project_settings
Outputget_output_files, create_distribution_zip, copy_output_files

A typical automated build session is: open_office_filebuild_dllget_compilation_errors (assert empty) → create_distribution_zipclose_project.


Terminal window
VBAPadlock64.exe "<office-file>" [switches]
SwitchDescription
(file path)Opens the Office file’s project in the Studio (GUI mode).
-silent / --silent / -sHides the main window: headless mode for automation. Combine with the auto-started MCP server to drive builds without any UI.
-mcp-stdio (or -mcp)Runs the MCP stdio bridge instead of the GUI (for Claude Desktop-style clients).

  1. Enable the MCP server in AI Settings and check Start server automatically when VBA Padlock opens.

  2. Start VBA Padlock headless on the build machine:

    Terminal window
    start "" "C:\Program Files\G.D.G. Software\VBA Padlock\VBAPadlock64.exe" -silent
  3. Drive the build from your MCP client. With Claude Code, for example, register the server once and then a single prompt does the whole job:

    Open C:\Projects\MyApp\MyWorkbook.xlsm, build the DLLs for both platforms, fail if there are compilation errors, then create a distribution ZIP in C:\Builds\MyApp.zip.

    The assistant chains open_office_filebuild_dllget_compilation_errorscreate_distribution_zip for you.


After building, verify the output DLLs exist; get_output_files returns the real paths, or check from a batch script:

Terminal window
@echo off
set PROJECT_DIR=C:\Projects\MyApp
:: Check all three DLLs exist
if not exist "%PROJECT_DIR%\bin\MyWorkbookrun32.dll" (
echo ERROR: Missing 32-bit runtime DLL
exit /b 1
)
if not exist "%PROJECT_DIR%\bin\MyWorkbookrun64.dll" (
echo ERROR: Missing 64-bit runtime DLL
exit /b 1
)
if not exist "%PROJECT_DIR%\bin\MyWorkbook.dll" (
echo ERROR: Missing satellite DLL
exit /b 1
)
echo All build artifacts verified.

  • VBA Padlock must be installed and licensed on the build machine.
  • The Office file and its .vbapadlock project folder must be in the repository.
  • The bin\ output directory should be in .gitignore.
  • VBA Padlock requires Windows. Use a self-hosted Windows runner; cloud Linux runners cannot work. Producing a protected Office file additionally requires Office installed on the runner.

Pipeline sketch (GitHub Actions, self-hosted Windows runner)

Section titled “Pipeline sketch (GitHub Actions, self-hosted Windows runner)”
name: Build VBA Padlock Projects
on: [push]
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Start VBA Padlock headless
shell: cmd
run: start "" "C:\Program Files\G.D.G. Software\VBA Padlock\VBAPadlock64.exe" -silent
- name: Build via MCP
shell: cmd
run: |
rem Drive the MCP server with your client of choice, e.g.:
rem claude -p "Open %GITHUB_WORKSPACE%\MyWorkbook.xlsm, build both DLL platforms, fail on compilation errors, copy outputs to %GITHUB_WORKSPACE%\dist"
your-mcp-client build-script.txt
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: protected-app
path: dist/

MyProject/
├── MyWorkbook.xlsm ← Office source file
├── MyWorkbook.vbapadlock/ ← Project folder (commit this)
│ ├── project.xml
│ ├── Main.bas
│ └── Helpers.cls
├── .gitignore ← Excludes bin/ and *_protected.*
└── bin/ ← Output (generated, do not commit)

Troubleshooting

Common build issues and solutions.

Read more →