Protect Word
Similar workflow tailored for Word documents and templates. Read the guide →
You have built a PowerPoint presentation that automates slide generation, applies complex layouts, or handles sensitive data exports — and you need to distribute it without exposing your source code.
In this tutorial, you’ll walk through the complete workflow: compiling your PowerPoint logic into a protected DLL, wiring it up to PowerPoint through the auto-generated VBA Bridge, and optionally adding activation keys with hardware locking.
Time needed: 15-20 minutes
Imagine you sell a “Slide Builder” tool: users open a template, click a button, and the macro automatically generates a complete slide deck based on external data, adds custom branding, and exports the result to PDF.
VBA Padlock allows you to commercialize this tool while keeping your proprietary layout algorithms and branding logic completely hidden inside a native DLL.
Start by opening your PowerPoint file in VBA Padlock to create a project that will hold your compiled code and licensing settings.
Launch VBA Padlock from the Start menu.
Click “Open Office File” in the ribbon and select your .pptm or .ppam file (for example, SlideBuilder.pptm).

Set Project Information
In the Project Info tab:
Slide Builder).
Switch to the Code Editor. This is where you write the VBA logic you want to hide. Below is an excerpt based on the real SlideBuilder example.

' PROTECTED CODE (Inside VBA Padlock)' These functions access PowerPoint's object model via the "Application" object.
' Add a title slide to the active presentationFunction AddTitleSlide(Title, Subtitle) Dim Pres, Sld, SlideIndex Set Pres = Application.ActivePresentation SlideIndex = Pres.Slides.Count + 1
' Create slide with Title layout (1) Set Sld = Pres.Slides.Add(SlideIndex, 1)
' Set title text If Sld.Shapes.HasTitle Then Sld.Shapes.Title.TextFrame.TextRange.Text = Title End If
' Set subtitle (usually placeholder index 2) On Error Resume Next Sld.Shapes.Placeholders(2).TextFrame.TextRange.Text = Subtitle On Error GoTo 0
AddTitleSlide = SlideIndexEnd Function
' Add a content slide with bullet pointsFunction AddContentSlide(Title, BulletPoints) Dim Pres, Sld, SlideIndex, i, Text Set Pres = Application.ActivePresentation SlideIndex = Pres.Slides.Count + 1
' Create slide with Title and Content layout (2) Set Sld = Pres.Slides.Add(SlideIndex, 2) Sld.Shapes.Title.TextFrame.TextRange.Text = Title
' Add bullet points from array Text = "" For i = LBound(BulletPoints) To UBound(BulletPoints) Text = Text & BulletPoints(i) & Chr(13) Next i Sld.Shapes.Placeholders(2).TextFrame.TextRange.Text = Text
AddContentSlide = SlideIndexEnd FunctionBuild the protected DLL that will replace your source code.
Click “Publish Final DLL” in the ribbon.
Click “Build Final DLL Files”.
VBA Padlock produces three DLLs in a bin subfolder next to your document:
SlideBuilderrun32.dll (32-bit runtime)SlideBuilderrun64.dll (64-bit runtime)SlideBuilder.dll (Your compiled code)The VBA Bridge is the connection between your PowerPoint file and the DLL.
Open your PowerPoint file in Microsoft PowerPoint.
In VBA Padlock, click Create VBA Bridge → Inject Into Office.
VBA Padlock adds the VBADLLBridge module to your PowerPoint project.

Now you can call your compiled functions from regular PowerPoint VBA code using VBAPL_Execute.

In the PowerPoint VBA Editor (Alt+F11), create a new module and add this:
'---------------------------------------------------------------' Call the compiled DLL functions'---------------------------------------------------------------
Sub Demo_AddTitleSlide() Dim SlideIndex As Variant
' Call the protected DLL function SlideIndex = VBAPL_Execute("AddTitleSlide", _ "My Awesome Presentation", _ "Created with VBA Padlock")
MsgBox "Title slide added at index " & SlideIndex, vbInformationEnd Sub
Sub Demo_AddContentSlide() Dim SlideIndex As Variant Dim Items As Variant
Items = Array("Protected Business Logic", _ "Native DLL Performance", _ "Secure Hardware Locking")
' Call the protected DLL function SlideIndex = VBAPL_Execute("AddContentSlide", "Key Features", Items)
MsgBox "Content slide added at index " & SlideIndex, vbInformationEnd Sub
To require an activation key before your presentation can be used:
Go to Licensing Features → Activation Settings.
Check Activation key is required.
Optional: Enable Hardware Locking to tie licenses to specific PCs.

Rebuild the DLL to apply the security settings.
Generate a test key in the Key Generator.

Package your application for release.
Click Distribute in the ribbon.
Select Create ZIP Archive.
The archive will contain your .pptm file and the bin folder (mandatory).

Protect Word
Similar workflow tailored for Word documents and templates. Read the guide →
Online Activation
Automate license activation over the internet. Read the guide →
VBA Bridge API
Full reference for all VBAPL_* functions.
View API reference →
VBA Compatibility
Check supported VBA features and statements. View reference →