Skip to content

Beakerboy/MS-OVBA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

176 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coverage Status

vbaProject-Compiler

Create a vbaProject.bin file from VBA source files.

Command Line Interface

Eventually it will be possible to use the CLI to create a vbaProject.bin file from source files and an optional configuration file.

VBAProject Class

The vbaProject class contains all the data and metadata that is used to create the OLE container. It can use this data to create several files, then compress and combine them into an OLE container

from ms_ovba.vbaProject import VbaProject
from ms_cfb.ole_file import OleFile


project = VbaProject()
thisWorkbook = DocModule("ThisWorkbook")
thisWorkbook.addFile(path)
project.addModule(thisWorkbook)

ProjectOleFile.write_file(project)

The VbaProject class has many layers of customization available. For example a library reference can be added to the project.

codePage = 0x04E4
codePageName = "cp" + str(codePage)
libidRef = ReferenceRecord(codePageName, LibidReference(
    "{00020430-0000-0000-C000-000000000046}",
    "2.0",
    "0",
    "C:\\Windows\\System32\\stdole2.tlb",
    "OLE Automation"
))
oleReference = Reference(codePageName, libidRef, "stdole")
project.addReference(oleReference)

About

Create a vbaProject.bin file from VBA source files.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages