Skip to content

Troubleshooting

If something is not working as expected, start here. This page groups the most common VBA Padlock issues by area, with practical fixes you can apply immediately.

  1. Compile first with F5 and fix every error in the Messages panel.
  2. Validate scripts in Test Runner before testing from Office.
  3. Re-inject VBA Bridge after any Security Code / project changes.
  4. Check bin/ deployment (all expected DLLs present, not blocked).
  5. If licensing is involved, verify activation settings and key/project match.

Compilation success in VBA Padlock

Cause: The VBA Padlock script contains syntax errors, unsupported functions, or references to undefined variables.

Solution:

  • Check the Messages panel for specific error messages and line numbers.
  • Review VBA Compatibility for unsupported features (e.g., no class modules, no Declare statements, no Office object model access inside scripts).
  • Ensure all functions used are either user-defined or from the built-in script libraries.

Test Runner dialog

Compilation succeeds but functions return errors at runtime

Section titled “Compilation succeeds but functions return errors at runtime”

Cause: The compiled function exists but encounters a runtime issue (wrong parameter count, type mismatch, etc.).

Solution:

  • Test your function in the Test Runner before injecting into Office.
  • Verify you are passing the correct number and types of parameters to match the compiled function’s signature.
  • Check the return value — VBAPL_Execute returns a Variant that may contain an error code.

Injection fails or fails to create the VBA Bridge in Office

Section titled “Injection fails or fails to create the VBA Bridge in Office”

Cause: VBA Padlock requires programmatic access to the Office VBA project to automate the injection of the bridge module. This access is disabled by default in Office for security reasons.

Solution: You must enable “Trust access to the VBA project object model” in your Office application settings:

  1. Open the Office application (Excel, Word, etc.).
  2. Go to File > Options.
  3. Select Trust Center in the left menu.
  4. Click the Trust Center Settings… button.
  5. Select Macro Settings in the left menu.
  6. Under Developer Macro Settings, check the Trust access to the VBA project object model box.
  7. Click OK and restart the Office application.

Trust access to the VBA project object model setting in Office Trust Center

VBA Bridge module generated in Studio

”DLL not found” or “File not found” error

Section titled “”DLL not found” or “File not found” error”

Cause: The Office file cannot find the DLL files.

Solution:

  • All three DLLs must be in a bin/ subdirectory relative to the Office file:
    MyWorkbook.xlsm
    bin\
    ├── MyWorkbookrun32.dll
    ├── MyWorkbookrun64.dll
    └── MyWorkbook.dll
  • Verify the bin/ directory exists and contains all three DLLs.
  • If the files were downloaded from the internet, right-click each DLL → Properties → check Unblock.

Distribution tab in VBA Padlock

“Verification failed” or Security Code mismatch

Section titled ““Verification failed” or Security Code mismatch”

Cause: The Security Code in the VBA Bridge does not match the one in the satellite DLL. This happens when you recompile without re-injecting the VBA Bridge.

Solution:

  1. In VBA Padlock, click Create VBA BridgeInject Into Office.
  2. Recompile with F5.
  3. Use Publish Final DLL to build the final version.

Cause: A DLL file was modified after compilation, or a file is corrupted.

Solution:

  • Recompile the project from VBA Padlock.
  • Do not modify or patch the DLL files after compilation — they are integrity-verified.
  • If the issue persists, try deleting the bin/ directory and rebuilding.

Key Generator in Licensing workspace

Cause: License storage permissions or conflicting installations.

Solution:

  • Ensure the user has write access to HKEY_CURRENT_USER (registry storage) or to the application folder (.LIC file storage).
  • Check the storage mode in Activation Settings.
  • If using portable mode, verify the .LIC file can be created next to the Office file.

Cause: The key format does not match, the key was generated for a different project, or the Hardware ID does not match.

Solution:

  • Verify the key was generated with the same project (matching Security Code and ECC keys).
  • Check for typos — common confusions: 0 vs O, 1 vs l, I vs l.
  • If using hardware-locked keys, verify the user’s System ID matches the one used to generate the key.
  • Use the Key Generator to regenerate the key if needed.

Cause: A hardware component used for the Hardware ID was replaced or updated (new hard drive, network adapter, etc.).

Solution:

  • Check which components are selected in Hardware ID Options.
  • Remove volatile components (e.g., MAC address) if users frequently change hardware.
  • Generate a new key for the user’s updated Hardware ID. See Key Generation guide.

Cause: Network issues, incorrect server URL, or server configuration problems.

Solution:

  • Verify the activation URL in Online Activation Settings.
  • Test the server connection from VBA Padlock using the Test Connection button.
  • Ensure the server uses HTTPS and the PHP activation kit is correctly deployed. See Activation Server guide.
  • Check the server error logs for details.

Online activation settings

Functions work in Test Runner but fail in Office

Section titled “Functions work in Test Runner but fail in Office”

Cause: The Office file may have an outdated Bridge module, or macros may be disabled.

Solution:

  • Re-inject the VBA Bridge: Create VBA BridgeInject Into Office.
  • Verify macros are enabled in Office Trust Center settings.

Cause: Some antivirus software flags DLLs with certain protection patterns as suspicious.

Solution:

  • This is a false positive. VBA Padlock runtime DLLs are digitally signed by G.D.G. Software.
  • Submit the DLL to your antivirus vendor for whitelisting.
  • Add the bin/ directory to your antivirus exclusion list.

VBA Padlock generates both 32-bit and 64-bit runtime DLLs. The VBA Bridge automatically detects the Office architecture and loads the correct DLL. No configuration is needed.

Compiled DLLs are compatible with Office 2016 and later, including Microsoft 365 desktop apps. The VBA Bridge uses Declare PtrSafe syntax for 64-bit compatibility.

Multiple Office files sharing the same DLL

Section titled “Multiple Office files sharing the same DLL”

Each Office file needs its own satellite DLL (compiled with its own Security Code). The runtime DLLs ({DLLName}run32.dll and {DLLName}run64.dll) are also project-specific, named after the project’s DLL name.

Issue: Office ARM is installed, and VBA Padlock DLLs fail to load.

Cause: Native ARM versions of Office cannot load standard x86 or x64 DLLs.

Solution:

  • On Windows ARM (like Surface Pro 11, Surface Laptop 7, or Snapdragon X Elite devices), uninstall the ARM-native version of Office and install Office 64-bit instead.
  • Office 64-bit on Windows ARM uses Microsoft’s Prism emulation. This allows the standard x64 versions of VBA Padlock DLLs to load and execute seamlessly without any modifications.

If your issue is not covered here: