VbaGitAfter Getting your apps scripts to Github I thought I'd have a go at doing something similar for VBA. If you are reading this, you'll know that it's very difficult to manage shared code, since VBA is really a container bound thing. You can do things with add-ins and by referencing other sheets, but the VBA environment is very specific to your machine and your folder structure. Sharing common code across Spreadsheet containers or between machines is just a mess. I have tried a few things in the past (actually they will still work but I wont be loading the latest version of code there any longer), such as How to update modules automatically in VBA which uses GIST to publish code from the web, but getting it there and figuring out dependencies was fairly manual. VbaGit is about managing your VBA code and getting it in and out of workbooks. If you distribute or share code, or need version control then this is probably of interest to you.
There's a lot of words here, so if you want to skip it and get started, go here - Getting started with VbaGit or VBA and jsdoc
What VbaGit doesIn the end, quite a lot actually - it kind of grew as I was playing around with it and realized what could be done. I find the automatic documentation especially useful
What VbaGit doesn't do
What's in the repoFor the discussion, I'll use the repo for the VbaGit project itself, which of course I used VbaGit to create.
Here's what this repo looks like when automatically created and committed. You can find the repo for VbaGit here.
The readme fileThis is committed if there isn't one in the repo, otherwise it leaves it alone. The idea is that you use the initial skeleton to build on. If you want the skeleton re-instated, just delete your readme from the repo. It doesn't say much and looks like this. This is created and committed to guthub stage if there's not already a README in the repository.
The dependency reportThis describes what's in the repo, a sample snip is shown below
Also in the dependency documentation you'll see which Excel references were detected in the workbook being processed. VbaGit is unable to associate excel references with procedures and therefore know exactly which if these would be needed in a subset of the original workbook, so you can either choose to apply them manually in any workbook you create when importing from git, or have doImportGit do it automatically for you (in which case it will apply them all)
The cross reference documentThis describes references between procedures, a sample snip is shown below
The info.jsonThis is used to create all the documentation above, and to control execution of VbaGit. Note that the info.json file will always be slightly newer than the one on github, since it records when it was committed after the commit completed. Take a look directly on github, it's a little big to reproduce below.
The scripts folderThis is the source for all your scripts in your project and looks like this
The libraries folderIf there are any, then all the libraries sources for each dependency needed by this project. Here's a snip below. Each module or class has a code file as well as a documentation file the same as was shown in the scripts folder above
Each folder name matches a library, and contains the source for that library. Note that every library that is referenced for which sources are available are committed here - including libraries that are referenced by other libraries and so on. This list matched the dependency list in the dependencies.md report.
|
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation >