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.
Before calling any other function, the DLL must be initialized by executing a compiled function (which triggers internal setup). The VBA Bridge handles this automatically via VBAPL_Execute.
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
# Function Category 1 VBAPLShowEULAEULA 2 VBAPLIsEulaAcceptedEULA 3 VBAPLGetEulaAcceptanceDateEULA 4 VBAPLIsLicenseValidLicense Status 5 VBAPLGetHardwareIDLicense Status 6 VBAPLShowActivationLicense Status 7 VBAPLDeactivateDeactivation 8 VBAPLGetDeactivationInfoDeactivation 9 VBAPLDeactivateGUIDeactivation 10 VBAPLIsTrialModeTrial 11 VBAPLGetTrialLimitLeftTrial 12 VBAPLHasStoredLicenseLicense Info 13 VBAPLGetRegisteredNameLicense Info 14 VBAPLShowTrialNagTrial 15 VBAPLGetPropertyProperties 16 VBAPLVerifyDLLSignatureSecurity 17 VBAPLValidateOnlineOnline Validation 18 VBAPLIsValidationRequiredOnline Validation 19 VBAPLLoadLocaleLocalization 20 VBAPLGetLocaleInfoLocalization