Skip to content

Setting Up Licensing

You have compiled your VBA code into a protected DLL—now it’s time to turn it into a commercial product or a controlled corporate tool. This guide walks you through setting up a complete licensing system, from basic activation to advanced hardware locking.

Time needed: 15-20 minutes


Whether you want to offer a 30-day trial or require a unique key for every PC, VBA Padlock gives you the tools to enforce your licensing terms without writing complex security code in VBA.


The first step is to tell VBA Padlock that your application requires a license key to run.

  1. Open your project in VBA Padlock.

  2. Navigate to Licensing FeaturesActivation Settings.

  3. Check Activation key is required.

    Activation Settings

  4. Choose your License Storage:

    • Registry (Default): Stores license data in HKEY_CURRENT_USER. Best for standard Windows installations.
    • Portable file (.lic): Stores the license in a file next to your document. Perfect for USB drives or “No Registry” environments.

How should the user see the license check? You can offer a trial period or force activation immediately.

Users can evaluate your tool before entering a full license key.

  1. Go to Advanced Activation.
  2. Check Allow compiled VBA code to run without activation. This allows the application to execute even without a license.
  3. Important: In this unlicensed state, the application runs silently. No “Nag Screen” is shown automatically.
  4. To display the remaining days and a purchase button (the Nag Screen), you must provide the user with a Trial Key generated in the Key Generator.
  5. Alternatively, you can use the VBA API to create your own custom trial logic.

End-user trial nag screen


To prevent users from sharing a single key across multiple computers, you can tie each license to the physical hardware.

  1. In Licensing Features, go to Hardware ID Options.

  2. Select the hardware components to monitor (CPU, Disk Serial, MAC Address).

    Hardware ID Options

  3. When enabled, the user’s activation dialog will display a unique System ID. They must send you this ID so you can generate a key that only works on their machine.


Once your settings are configured and you’ve published your DLL, you can generate keys for your customers.

  1. Go to Licensing FeaturesKey Generator.

  2. Enter the Registered Name (e.g., “John Doe”).

  3. Pace the user’s System ID if hardware locking is enabled.

  4. Click Generate Key.

    Key Generator


For a truly professional experience, you can automate key delivery over the internet.

  1. Navigate to Online Activation Settings.

  2. Enable Online activation.

  3. Deploy the VBA Padlock Activation Kit (PHP/MySQL) to your web server.

    Online Activation Settings


Before sending your protected file to a client, perform these tests:

  • Trial Test: Does the application open without a key? Is the remaining time correct?
  • Activation Test: Does a generated key correctly unlock the application?
  • Locking Test: Does a hardware-locked key fail on a different computer?
  • UI Test: Does the activation dialog display your custom logo and links?

Deactivation

Allow users to transfer their license to a new PC. View feature →

Protect Excel

Ready to ship? Build your finalized Excel project. View guide →