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 and per-module metadata
    • Main.bas Default entry module (may be an empty stub)
    • Greetings.bas Module extracted from the workbook
    • PriceEngine.cls Class module (extracted or hand-written)
    • Greetings.bas.bak Divergence backup (created before an overwrite)
    • 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
  • Per-module metadata for the automatic workflow: each module’s origin (auto-extracted from the Office file vs hand-authored), its source host module, its last compile verdict (pass/partial/fail), and its Lock from Re-analyze flag
  • The References selection (which Library\ constant modules compile into the DLL)
  • One-shot flags such as the first-open auto-analyze marker

Each .bas file is a standard VBA module, and each .cls file a class module, compiled into your protected DLL. In the automatic workflow most of them are extracted from your Office file during analysis and kept in sync by Re-analyze; you can add hand-written modules alongside them.

FileRoleDescription
Main.basmainDefault entry module. Functions called without a module prefix are searched here. Created automatically; often stays an empty stub in automatic projects.
*.bascustomStandard modules (extracted or hand-written).
*.clsclassClass modules, compiled into the DLL and removed from the protected document.
*.bakbackupCreated by the divergence guard before a stored module is overwritten.

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

Produce writes the protected copy next to your source and the runtime artifacts into bin/:

  • MyWorkbook.xlsm Source file (never modified)
  • MyWorkbook_protected.xlsm Protected copy (wrappers + 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 source file
    • MyWorkbook_protected.xlsm Protected copy produced by VBA Padlock
    • DirectoryMyWorkbook.vbapadlock/
      • project.xml All project settings + module metadata
      • Main.bas Default entry module
      • Utilities.bas Helper functions module
      • PriceEngine.cls Protected class 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/.cls modules, optional mainicon.ico)

Exclude from repository:

  • bin/ output folder
  • The produced *_protected.* copies
  • .bak divergence backups
# VBA Padlock build output
bin/
*_protected.*
*.bak

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 →