GitHub and VBA integration

If you develop shared code for VBA, you’ve probably got some massive workbooks that contain multiple projects that you wish you could separate, but it’s too complicated because they are sharing classes and functions.

The problem is that VBA is, by its nature, most comfortable when it’s self contained inside a particular workbook. Once you start trying to share code across workbooks, moving to another machine or user, or reorganizing where things are, everything tends to all apart.

Nowadays I spend most of my playing around time implementing things in Google Apps Script, but this time I took an apps script project (Getting your scripts and libraries to github)  and recreated it for VBA.

integrate VBA with Github shows how you could automatically split up workbooks into projects, commit the code to github for version control and distribution, and reconstruct them in fresh workbooks with just the code you need.

Automated documentation

As a side effect of that you get automatic documentation for each of your procedures. I’ll show some snippets of examples below. Here’s the git repo I for the VbaGit code (created of course by itself). 
Some of the documentation created as part of the commit process includes
dependencies (info on all modules and classes needed to make your selected module(s) compile), as well as detected excel references. A small snippet looks like this.
cross references. Shows which procedures reference which others. A small snippet below
Module documentation. Showing the return and arguments types for every procedure in every module in the dependency module list.
VbaGit uses the Github API to commit and pull code, or if you prefer you can use a regular git client. Using information in the github repo it can recreate an entire project with its dependent classes and modules in a clean worksheet. 
For more details, or to get this capability take a look at the desktop liberation site

Author: bm082975

Leave a Reply

Your email address will not be published. Required fields are marked *