Run-time API functions
VbaCompiler for Excel provides run-time API functions to get access to the data which is available on customer side, only during application run time.
All the functions are declared in the “mdlDoneExVbaCompilerRtmAPI.bas” module. You can find this VBA module in the ‘src’ sub-folder, which is contained inside the VbaCompiler for Excel installation folder.
To use the run-time functions, you need to import the “mdlDoneExVbaCompilerRtmAPI.bas” module into your workbook VBA project before compilation. In the case that the function names from a file conflict with the names in your VBA project, you need to use the file name for coding the function call.
For example:
If mdlDoneExVbaCompilerRtmAPI.IsVbaCompiled() Then
In your original (with uncompiled VBA code) workbook the functions: IsVbaCompiled, IsRegkeyAvailable, IsTrialMode will return ‘False’, and all other functions trigger the VBA run-time error.
The function IsVbaCompiled returns True if it is called from the compiled VBA code and return False otherwise.
The function IsRegkeyAvaialble returns True if it is called during run-time in VBA code compiled with the ‘Copy Protection with Registration Key’ option turned on and when the valid registration key is present. Otherwise the function returns ‘False’.
The function IsTrialMode returns True if it is called during run-time in VBA code compiled with the ‘Copy Protection with registration key’ and the ‘Trial mode’ options selected. Otherwise the function returns ‘False’.
The function IsFreemiumMode returns True if it is called during run-time in VBA code compiled with the ‘Copy Protection with registration key’ and the ‘Freemium mode’ options selected. Otherwise the function returns ‘False’.
The function GetTrialDaysLeft returns the amount of days available in Trial mode. The function returns a value only if the function is called from VBA code compiled with the ‘Copy protection with registration key’ and the ‘Trial version’ options selected. Otherwise this function will trigger a VBA run-time error.
The function GetRegKeyFileName returns the full name of the registration key file as a string if the valid regkey file is present. The function returns the value only if the function is called from VBA code compiled with the ‘Copy protection with registration key’ and the ‘Trial version’ options selected. Otherwise this function will trigger a VBA run-time error.
The function GetComputerId returns the compiler identification number of the computer where the compiled VBA code is running. The function returns the value in run-time only if the VBA code was compiled with the ‘Copy protection with registration key’ option selected. Otherwise it will raise a VBA run-time error.
The function GetRegisteredName returns the name of the licensee from the registration key. This is the value you have entered into the ‘Name’ field on the registration key form when you created the regkey. The function returns the value in run-time only if the VBA code was compiled with the ‘Copy protection with registration key’ option selected, and the valid registration key file is present. Otherwise the function will raise a VBA run-time error.
The function GetRegisteredEMail returns the email of licensee from the registration key. This is the value you have entered into the ‘E-Mail’ field on the registration key form when you created the regkey. The function returns the value in run-time only if the VBA code was compiled with the ‘Copy protection with registration key’ option selected, and a valid registration key file is present. Otherwise the function will raise a VBA run-time error.
The function GetDateFrom returns the starting date of the registration key validity term. This is a value you have entered into the ‘Limit usage period’ >> ‘from’ field on the registration key form when you created the regkey. The function returns the value in run-time only if the VBA code was compiled with the ‘Copy protection with registration key’ option selected, and a valid registration key file with date limitation is present. Otherwise the function will raise a VBA run-time error.
The function GetDateTo returns the end date of the registration key validity term. This is a value you have entered into the ‘Limit usage period’ >> ‘to‘ field on the registration key form when you created the regkey. The function returns the value in run-time only if the VBA code was compiled with the ‘Copy protection with registration key’ option selected, and a valid registration key file with date limitation is present. Otherwise the function will raise a VBA run-time error.
The function GetApplicationName returns the application name value. The ‘Application name’ is a string value you have entered in the ‘Application name’ field on compilation settings form of the VbaCompiler. The function returns the value in run-time only if the VBA code was compiled with the ‘Copy protection with registration key’ option selected. Otherwise the function will raise a VBA run-time error.