Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Beakerboy/vbaProject-Compiler
Create a vbaProject.bin file from VBA source files.
https://github.com/Beakerboy/vbaProject-Compiler
Last synced: 3 months ago
JSON representation
Create a vbaProject.bin file from VBA source files.
- Host: GitHub
- URL: https://github.com/Beakerboy/vbaProject-Compiler
- Owner: Beakerboy
- Created: 2023-01-09T14:24:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-17T11:17:58.000Z (12 months ago)
- Last Synced: 2024-05-28T04:09:46.534Z (6 months ago)
- Language: Python
- Homepage:
- Size: 681 KB
- Stars: 13
- Watchers: 4
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - Beakerboy/vbaProject-Compiler - Create a vbaProject.bin file from VBA source files. (Python)
README
[![Coverage Status](https://coveralls.io/repos/github/Beakerboy/vbaProject-Compiler/badge.svg?branch=main)](https://coveralls.io/github/Beakerboy/vbaProject-Compiler?branch=main)
# vbaProject-Compiler
Create a vbaProject.bin file from VBA source files.## VBAProject Class
The vbaProject class contains all the data and metadata that will be used to create the OLE container.
```python
from vbaProjectCompiler.vbaProject import VbaProject
from vbaProjectCompiler.ole_file import OleFileproject = VbaProject()
thisWorkbook = DocModule("ThisWorkbook")
thisWorkbook.addFile(path)
project.addModule(thisWorkbook)ole_file = OleFile(project)
ole_file.writeFile(".")
```The VbaProject class has many layers of customization available. Forexample a librry referenece can be added to the project.
```python
codePage = 0x04E4
codePageName = "cp" + str(codePage)
libidRef = LibidReference(
"windows",
"{00020430-0000-0000-C000-000000000046}",
"2.0",
"0",
"C:\\Windows\\System32\\stdole2.tlb",
"OLE Automation"
)
oleReference = ReferenceRecord(codePageName, "stdole", libidRef)
project.addReference(oleReference)
```## oleFile Class
Users should not have to interact with the oleFile class. It's job is to extract the data from the vbaProject and turn it into a valid file. This includes deciding which data stream appears where, and applying different views to the models to save the data in the correct formats.
The oleFIle has two parts, a header and a FAT Sector Chain. This FAT chain stores multiple streams of data:
* Fat Chain Stream
* Directory Stream
* Minifat Chain Stream
* Minifat Data Stream
* Fat Data StreamThese are all different views of data from the following Models
* fatChain
* minifatChain
* directoryStream