The VBA Padlock runtime DLL exports a set of stdcall functions that can be called directly from any language that supports Windows DLL calls. This page documents every exported function with its native signature.
Note
Most developers should use the VBA Bridge API instead of calling these exports directly. The VBA Bridge wraps these functions with error handling, automatic DLL loading, and 32/64-bit detection. This page is intended for advanced scenarios such as calling VBA Padlock from C#, Delphi, Python, or other languages.
VBA Padlock produces two runtime DLLs per project, one for each Office architecture. The DLL names are derived from your project name using the pattern {ProjectName}run32.dll and {ProjectName}run64.dll:
File Architecture Usage [YourProject]run32.dll32-bit (x86) Used with 32-bit Office [YourProject]run64.dll64-bit (x64) Used with 64-bit Office
For example, if your project is named MyApp, the runtime DLLs are MyApprun32.dll and MyApprun64.dll.
Both DLLs export the same functions with the same stdcall calling convention.
Initializes the runtime and binds it to the host application. The VBA Bridge calls this automatically on first use; call it yourself only when driving the DLL from another language.
function VBAPLInit ( const ApplicationCallerRef: OleVariant ; SecurityCode: Cardinal ): Integer ; stdcall ;
Parameter Type Description ApplicationCallerRefOleVariantThe host Application COM object (Excel, Word, PowerPoint, or Access). SecurityCodeCardinalThe project’s Security Code (whole number between 1 and 2147483647, from Project Info).
Returns: a positive value on success; 0 or negative on failure (wrong Security Code, missing satellite DLL, …).
Execute a compiled function with 0 to 4 arguments.
function ExecuteVBAFunction0 ( const ID: OleVariant ): OleVariant ; stdcall ;
function ExecuteVBAFunction1 ( const ID, Param1: OleVariant ): OleVariant ; stdcall ;
function ExecuteVBAFunction2 ( const ID, Param1, Param2: OleVariant ): OleVariant ; stdcall ;
function ExecuteVBAFunction3 ( const ID, Param1, Param2, Param3: OleVariant ): OleVariant ; stdcall ;
function ExecuteVBAFunction4 ( const ID, Param1, Param2, Param3, Param4: OleVariant ): OleVariant ; stdcall ;
Parameter Type Description IDOleVariantFunction identifier: "ModuleName|FunctionName" or just "FunctionName" (searched in the default Main script). Param1..4OleVariantArguments passed through to the compiled routine.
Returns: The value returned by the compiled function. On licensing/security failure the runtime returns the string codes NOT_LICENSED or SECURITY_BLOCKED.
Executes a compiled function with any number of arguments, packed as a SAFEARRAY of Variants.
function ExecuteVBAFunctionN ( const ID: OleVariant ; const Args: OleVariant ): OleVariant ; stdcall ;
The VBA Bridge’s VBAPL_Execute routes calls with 0-4 arguments to the dedicated exports above and everything else here, transparently.
Evaluation entry point optimized for worksheet-formula (UDF) calls with a single parameter. Like the execution family, it enforces EULA acceptance and license state before running.
function VBAPLEvalFormD ( const ID, Param: OleVariant ): OleVariant ; stdcall ;
Displays the EULA dialog.
function VBAPLShowEULA (ForceDisplay: Integer ): Integer ; stdcall ;
Private Declare Function VBAPLShowEULA Lib " MyApprun32.dll " _
( ByVal ForceDisplay As Long ) As Long
Private Declare PtrSafe Function VBAPLShowEULA Lib " MyApprun64.dll " _
( ByVal ForceDisplay As Long ) As Long
[DllImport( " MyApprun32.dll " , CallingConvention = CallingConvention . StdCall )]
static extern int VBAPLShowEULA ( int ForceDisplay);
Parameter Type Description ForceDisplayInteger1 = force display even if already accepted. 0 = normal behavior.
Return Meaning 1Accepted 0Declined or cancelled -1Error showing dialog -2EULA not configured
Checks if the EULA has been accepted.
function VBAPLIsEulaAccepted : Integer ; stdcall ;
Return Meaning 1Accepted 0Not accepted -1Not configured
Returns the EULA acceptance date as an ISO string.
function VBAPLGetEulaAcceptanceDate ( out OutDate: WideString ): Integer ; stdcall ;
Parameter Type Direction Description OutDateWideStringOut Receives the date in YYYY-MM-DD HH:NN:SS format.
Return Meaning 0Success -1Not configured or not accepted
Checks if the current license is valid.
function VBAPLIsLicenseValid : Integer ; stdcall ;
Return Meaning 1Valid (or activation not required) 0Invalid -1Not initialized
Returns the project-specific Hardware ID for this machine.
function VBAPLGetHardwareID ( out OutHardwareID: WideString ): Integer ; stdcall ;
Parameter Type Direction Description OutHardwareIDWideStringOut Receives the Hardware ID string.
Return Meaning 0Success -1Not initialized -2Error generating Hardware ID
Shows the activation dialog.
function VBAPLShowActivation (ForceDisplay: Integer ): Integer ; stdcall ;
Parameter Type Description ForceDisplayInteger1 = force display, 0 = normal.
Return Meaning 1Activation successful 0Cancelled or failed -1Not initialized -2Activation not configured
Deactivates the license programmatically (no GUI).
function VBAPLDeactivate ( out OutCertificate: WideString ): Integer ; stdcall ;
Parameter Type Direction Description OutCertificateWideStringOut Receives the deactivation certificate string.
Return Meaning 0Success -1Not initialized -2No license stored -3Already deactivated -4Deactivation not allowed -5Internal error
Returns the deactivation status.
function VBAPLGetDeactivationInfo : Integer ; stdcall ;
Return Meaning 0Allowed (license active) 1Allowed (no license stored) 2Not allowed 3Already deactivated -1Not initialized
Shows a deactivation dialog with certificate display.
function VBAPLDeactivateGUI : Integer ; stdcall ;
Return Meaning 0Success 1Cancelled by user -1Not initialized -2No license stored -3Already deactivated -4Not allowed -5Internal error
Checks if running in trial mode.
function VBAPLIsTrialMode : Integer ; stdcall ;
Return Meaning 1Trial mode 0Not trial mode -1Not initialized
Returns the remaining trial limit.
function VBAPLGetTrialLimitLeft : Integer ; stdcall ;
Return Meaning >= 0Remaining limit (days, runs, or days until expiration) -1Not initialized -2Not in trial mode
Checks if a license key is stored.
function VBAPLHasStoredLicense : Integer ; stdcall ;
Return Meaning 1License stored 0No license -1Not initialized
Returns the registered user name.
function VBAPLGetRegisteredName ( out OutName: WideString ): Integer ; stdcall ;
Parameter Type Direction Description OutNameWideStringOut Receives the registered name.
Return Meaning 0Success -1Not initialized -2No license stored
Shows the trial nag screen.
function VBAPLShowTrialNag (ForceDisplay: Integer ): Integer ; stdcall ;
Parameter Type Description ForceDisplayInteger1 = force display, 0 = normal.
Return Meaning 0Continue trial 1Activate 2Purchase (URL opened) -1Not initialized -2Not in trial mode -3Silent mode enabled
Returns a project property value.
function VBAPLGetProperty ( const PropName: OleVariant ; const DefValue: OleVariant ): OleVariant ; stdcall ;
Parameter Type Description PropNameOleVariantProperty name (case-insensitive): AppTitle, AppVersion, AppCompany, AppCopyright, AppDescription, RegisteredName, LicenseKey. DefValueOleVariantDefault value returned if the property is not found.
Returns: The property value, or DefValue if not found.
Verifies the Authenticode signature of the runtime DLL.
function VBAPLVerifyDLLSignature : Integer ; stdcall ;
Return Meaning 0Valid (signed by G.D.G. Software) 1Not signed 2Invalid or corrupted signature 3Wrong publisher 4Certificate expired 5System error
Performs an online license validation against the activation server.
function VBAPLValidateOnline (Silent: Integer = 1 ): Integer ; stdcall ;
Parameter Type Default Description SilentInteger10 = show error dialogs, 1 = silent mode.
Return Meaning 1Validation successful 0Failed or license revoked -1Not initialized -2Online validation not configured -3No license stored -4Network error -5Server error -6Security validation failed
Checks if an online validation is due (based on the configured interval).
function VBAPLIsValidationRequired : Integer ; stdcall ;
Return Meaning 1Validation required now 0Not required yet -1Not initialized -2Online validation not configured
Loads localization strings from a JSON string. This overrides the built-in English strings used in activation dialogs, trial nag screens, and other UI elements.
function VBAPLLoadLocale ( const JSONContent: WideString ): Integer ; stdcall ;
Parameter Type Description JSONContentWideStringA JSON object containing key-value pairs for localized strings.
Return Meaning 1Success 0Failed (invalid JSON) -1Empty content
Returns information about the currently loaded locale.
function VBAPLGetLocaleInfo ( out OutLocale: WideString ): Integer ; stdcall ;
Parameter Type Direction Description OutLocaleWideStringOut Receives locale information.
Return Meaning 1Custom locale loaded 0Using default locale
28 exports in total:
# Function Category 1 VBAPLInitInitialization 2 ExecuteVBAFunction0Execution 3 ExecuteVBAFunction1Execution 4 ExecuteVBAFunction2Execution 5 ExecuteVBAFunction3Execution 6 ExecuteVBAFunction4Execution 7 ExecuteVBAFunctionNExecution 8 VBAPLEvalFormDExecution (UDF path) 9 VBAPLShowEULAEULA 10 VBAPLIsEulaAcceptedEULA 11 VBAPLGetEulaAcceptanceDateEULA 12 VBAPLIsLicenseValidLicense Status 13 VBAPLGetHardwareIDLicense Status 14 VBAPLShowActivationLicense Status 15 VBAPLDeactivateDeactivation 16 VBAPLGetDeactivationInfoDeactivation 17 VBAPLDeactivateGUIDeactivation 18 VBAPLIsTrialModeTrial 19 VBAPLGetTrialLimitLeftTrial 20 VBAPLHasStoredLicenseLicense Info 21 VBAPLGetRegisteredNameLicense Info 22 VBAPLShowTrialNagTrial 23 VBAPLGetPropertyProperties 24 VBAPLVerifyDLLSignatureSecurity 25 VBAPLValidateOnlineOnline Validation 26 VBAPLIsValidationRequiredOnline Validation 27 VBAPLLoadLocaleLocalization 28 VBAPLGetLocaleInfoLocalization