Skip to content

VBA Bridge

The VBA Bridge is the VBAPLBridge module: a specialized piece of VBA code that allows Microsoft Excel, Word, PowerPoint, or Access to securely load and interact with your protected DLL. In the automatic workflow you never have to think about it; it ships inside your workbook from the start and Produce keeps it up to date. The Create VBA Bridge dialog (Protect tab → Advanced group) exists for when you want to inspect, export, or manually inject it.

The VBA Bridge module view in VBA Padlock Studio


  • It’s already there. When your project is set up, the VBAPLBridge module is placed in your Office file, so your project keeps running in plain VBA before you produce, and the generated wrappers have something to call from day one.
  • Produce refreshes it. Every Produce run replaces the bridge with a version matching your current settings (DLL name, Security Code), and cleans up modules from older versions (VBAPadlockBridge, VBADLLBridge) if it finds them.
  • Missing DLL grace: if the runtime DLL can’t be found (say, someone moved the file without its bin\ folder), the bridge reports it once with recovery steps, then returns safe defaults instead of raising an error on every call.

The generated module is complex under the hood, but simple to use. It handles all technical plumbing so you can focus on your code:

  • Dual Architecture Support: Automatically generates both 32-bit and 64-bit API declarations, with PtrSafe support for 64-bit Office, ensuring seamless compatibility across Office versions.
  • Secure Initialization: Includes logic to safely locate and bind to your satellite DLLs in the bin\ subdirectory, preventing “DLL not found” errors.
  • The VBAPL_* API: Provides 20 high-level functions for core tasks like code execution, license validation, and online activation.

For advanced scenarios, the Create VBA Bridge dialog offers several ways to get the bridge code into a document yourself:

  1. Direct Injection: Click Inject Into Office to have the Studio automatically open your document and insert/update the module for you.
  2. Module Export: Export VBA Module saves the code as a standard .bas file for manual import into complex projects.
  3. Clipboard Sync: Copy Code To Clipboard lets you paste the module source straight into the VBA Editor (Alt + F11).

Produce & Test Run

The pipeline that injects and refreshes the bridge. View Reference →