Skip to content

Protect a PowerPoint Presentation

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.

  1. Launch VBA Padlock from the Start menu.

  2. Click “Open Office File” in the ribbon and select your .pptm or .ppam file (for example, SlideBuilder.pptm).

    VBA Padlock Welcome Screen

  3. Set Project Information

    In the Project Info tab:

    • Application Title: Give your tool a name (e.g., Slide Builder).
    • Security Code: Click Generate to create the unique cryptographic link between your presentation and the DLL.

    Project Information Settings


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.

VBA Padlock Code Editor

' PROTECTED CODE (Inside VBA Padlock)
' These functions access PowerPoint's object model via the "Application" object.
' Add a title slide to the active presentation
Function 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 = SlideIndex
End Function
' Add a content slide with bullet points
Function 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 = SlideIndex
End Function

Build the protected DLL that will replace your source code.

  1. Click “Publish Final DLL” in the ribbon.

  2. Click “Build Final DLL Files”.

  3. 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.

  1. Open your PowerPoint file in Microsoft PowerPoint.

  2. In VBA Padlock, click Create VBA BridgeInject Into Office.

  3. VBA Padlock adds the VBADLLBridge module to your PowerPoint project.

    VBA Bridge Module


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

PowerPoint VBA Editor

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, vbInformation
End 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, vbInformation
End Sub

Generated Slides


To require an activation key before your presentation can be used:

  1. Go to Licensing FeaturesActivation Settings.

  2. Check Activation key is required.

  3. Optional: Enable Hardware Locking to tie licenses to specific PCs.

    Activation Settings

  4. Rebuild the DLL to apply the security settings.

  5. Generate a test key in the Key Generator.

    Key Generator


Package your application for release.

  1. Click Distribute in the ribbon.

  2. Select Create ZIP Archive.

  3. The archive will contain your .pptm file and the bin folder (mandatory).

    Distribution Tab


Protect Word

Similar workflow tailored for Word documents and templates. Read the guide →