Beakerboy / vbaProject-Compiler

Create a vbaProject.bin file from VBA source files.
15 stars 3 forks source link

Process? #2

Closed Beakerboy closed 1 year ago

Beakerboy commented 1 year ago

Compress source code From a blank vbaProject.bin:

sancarn commented 1 year ago

@Beakerboy Might be worth dumping all useful documentation links into the issue.

I'm guessing the idea is to generate a pcodeless file with compressed src code only?

Beakerboy commented 1 year ago

I have an issue called “sources” with links to helpful information towards understanding OLE files, and VBAProject files. Yes, the idea is to point this script to a directory of VBA files, and it will package them up into a vbaProject.bin file. I already have a python script that will take a bin file and a directory of the unzippped contents of and xlam file, combine them and zip them up. I plan on using exel-press to perform the source code compression. I have not tested that project yet.

sancarn commented 1 year ago

Yes, the idea is to point this script to a directory of VBA files

Would it be worth splitting the project up into:

  1. A high-level class allowing basic write-functionality (p.s I don't know python at all... 👀 )
class VBAProject
   def __init__(sProjectName)
     ...
   def addModule(sBasTextOrStream, visible=true)
     ...
   def addClassModule(sBasTextOrStream, visible=true) 
     ...
   def addUserformModule(sBasTextOrStream, visible=true)
     ...
   def addReference(...)
     ...
   def saveAs(sFile)
     ...
   ...
  1. A seperate script to translate the file structure into the BIN file using the above class as a library.

Then anyone can integrate the use of the class into their own desired environment.


This may well be how you are planning to set things out already 😛

Beakerboy commented 1 year ago

P.S. I don't know python either. I'm learning the language by making this project. Feel free to add more noob-tier skills to it.