Skip to content

Project Format Reference

Every VBA Padlock project is stored as a directory next to your Office file. Understanding this layout makes backup, version control, CI builds, and troubleshooting much easier.

Project folder

<OfficeFileName>.vbapadlock next to your .xlsm, .docm, .accdb, or .pptm file.

Core source

Main.bas + additional .bas modules are your protected script source files.

Build output

Final binaries are generated into a sibling bin/ directory.

When you open an Office file, VBA Padlock automatically looks for a folder with the same base name and .vbapadlock suffix.

  1. Open MyWorkbook.xlsm in VBA Padlock Studio.
  2. VBA Padlock checks for MyWorkbook.vbapadlock/ in the same folder.
  3. If missing, it creates the folder and initializes project files.
Office FileExpected Project Directory
MyWorkbook.xlsmMyWorkbook.vbapadlock\
Report.docmReport.vbapadlock\
Database.accdbDatabase.vbapadlock\
Presentation.pptmPresentation.vbapadlock\
  • DirectoryMyWorkbook.vbapadlock/
    • project.xml Project settings (managed by VBA Padlock Studio)
    • Main.bas Main script module (required)
    • Module2.bas Additional script module (optional)
    • Helpers.bas Additional script module (optional)
    • mainicon.ico Custom DLL icon (optional)

Project information panel where project metadata and icon are configured

project.xml is the central settings file for your project (managed internally by VBA Padlock Studio). It stores:

  • Application metadata (title, version, company, description)
  • Compilation and publishing settings
  • Licensing configuration (activation/deactivation/trial/EULA/online validation)
  • Hardware ID and key generator parameters

Each .bas file corresponds to a VBA module that will be compiled into your protected DLL.

FileRoleDescription
Main.basmainRequired entry module for compiled code execution.
*.bascustomOptional additional modules (helpers, business logic, APIs).

Code editor with VBA script modules ready for compilation

Recommended format:

  • Encoding: UTF-8
  • Line endings: CRLF or LF (both supported)
  • Content: Standard VBA + built-ins from script functions

Example Main.bas:

' Main module - entry point for the compiled application
Public Function Initialize() As String
Initialize = "Application initialized successfully"
End Function
Public Function CalculatePrice(quantity As Long, unitPrice As Double, taxRate As Double) As Double
CalculatePrice = quantity * unitPrice * (1 + taxRate)
End Function

If present, mainicon.ico is embedded into generated DLL resources.

  • Format: Windows ICO
  • Recommended multi-size icon: 16, 32, 48, 256 px

FormatStorageStatus
External (current)Individual .bas files in .vbapadlockRecommended for all new projects
LegacyInline scripts in .vbaplprojSupported for backward compatibility

After compilation/publish, VBA Padlock creates runtime artifacts in bin/ next to the Office file:

  • MyWorkbook.xlsm Protected Office file (contains VBA Bridge)
  • Directorybin/
    • MyWorkbookrun32.dll 32-bit runtime (for 32-bit Office)
    • MyWorkbookrun64.dll 64-bit runtime (for 64-bit Office)
    • MyWorkbook.dll Satellite DLL (compiled bytecode)

Compilation result showing generated protected artifacts

FileDescriptionRequired for deployment
MyWorkbookrun32.dll32-bit runtime loaderYes
MyWorkbookrun64.dll64-bit runtime loaderYes
MyWorkbook.dllSatellite DLL containing protected bytecodeYes

  • DirectoryC:\Projects\MyApp\
    • MyWorkbook.xlsm Office file with VBA Bridge injected
    • DirectoryMyWorkbook.vbapadlock/
      • project.xml All project settings
      • Main.bas Main compiled module
      • Utilities.bas Helper functions module
      • mainicon.ico Custom DLL icon
    • Directorybin/
      • MyWorkbookrun32.dll 32-bit runtime
      • MyWorkbookrun64.dll 64-bit runtime
      • MyWorkbook.dll Satellite DLL

ExtensionApplicationDescription
.xlsmExcelMacro-enabled workbook
.xlsbExcelBinary workbook (macro-enabled)
.xla / .xlamExcelAdd-in
.docmWordMacro-enabled document
.dotmWordMacro-enabled template
.accdbAccessDatabase
.accdeAccessExecute-only database
.pptmPowerPointMacro-enabled presentation
.ppamPowerPointAdd-in

Track source and configuration, ignore generated artifacts.

Include in repository:

  • Office file (.xlsm, .docm, etc.)
  • .vbapadlock/ directory (project.xml, .bas modules, optional mainicon.ico)

Exclude from repository:

  • bin/ output folder
  • Temporary .vbaplcode files
# VBA Padlock build output
bin/
*.vbaplcode

Creating Your First Project

Step-by-step setup from opening a document to first compilation. Open guide →

Batch Compilation & CI/CD

Automate builds with command-line switches and pipelines. Open guide →

Distribution

Package and ship your Office file with all required runtime files. Open reference →