Metadata-Version: 2.4
Name: ms_ovba
Version: 0.0.1
Summary: Create a vbaProject.bin file from VBA source files.
Author-email: Kevin Nowaczyk <beakerboy99@yahoo.com>
Project-URL: Homepage, https://github.com/Beakerboy/MS-OVBA
Project-URL: Bug Tracker, https://github.com/Beakerboy/MS-OVBA/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: ms_cfb
Requires-Dist: ms_ovba_compression
Requires-Dist: ms_ovba_crypto
Provides-Extra: tests
Requires-Dist: mypy; extra == "tests"
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Requires-Dist: pytest-mock; extra == "tests"
Requires-Dist: coveralls; extra == "tests"
Requires-Dist: pep8-naming; extra == "tests"
Requires-Dist: flake8-annotations; extra == "tests"

[![Coverage Status](https://coveralls.io/repos/github/Beakerboy/MS-OVBA/badge.svg?branch=main)](https://coveralls.io/github/Beakerboy/MS-OVBA?branch=main)
# 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

```python
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.

```python
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)
```
