VB-Projects and GitHub
- Common advantages
- Specifics for “productive” Workbooks/VB-Projects
- Turning a dedicated VB-Project folder into a (cloned) GitHub repo
All my VB-Projects, including all my Common Components hosting Workbooks 1 are GitHub repositories since several years and I found the (positive) experience worth sharing it.
Common advantages
- GitHub is free of any charge no matter whether the VB-Project remains private or is made public
- GitHub versions any changes, provided changed components are - preferably automated along with the
Workbook_BeforeSave
event - exported. This kind of automation may be done by means of the Common Components Management service Export Changed Components 2. - GitHub provides the means to make a code change in a branch first and once successfully tested merge the branch into the master.
- When turned public other GitHub users may make use of the project or even contribute to it
- An optional but rather obligatory README document provides the place for the description, installation and usage of the project
- All outside the Vb-Project documents use Markdown which is easy to use and sufficiently capable for a user friendly appearance. A good example for this is Microsoft’s VB Documentation.
Specifics for “productive” Workbooks/VB-Projects
Considering GitHub for Common Components (specifically when hosted in a dedicated Workbook) is definitely an option since those kind of components usually do not imply data. Considering GitHub for a ++productive++ Workbook/VB-Project appears much less obvious if not an absolute nonsense at first glance. What makes it considerable is a VB-Project Synchronization Service like the one provided by my Common Components Management Workbook/Addin: While the productive Workbook remains in place, its VB-Project is maintained/modified in a copy and the productive VB-Project is finally synchronized with the copy, thereby minimizing the productive Workbook’s downtime. Less development stress = better (tested!) result.
Turning a dedicated VB-Project folder into a (cloned) GitHub repo
Preconditions
- A GitHub user account
- The Workbook “lives” in a dedicated parent folder 3
Steps
- Install and open GitHub Desktop
-
Use _File Add local repository …_ to turn a dedicated Workbook folder into a GitHub repo - Create a folder dedicated for Export-Files, e.g. name it source
- Either export changed VBComponents manually (e.g. by MZTools or the native VB-Editor) or have this automated using the corresponding Common Component Management service service
- Use GitHub Desktop to Commit made changes and Push them to your GitHub repo (https://github.com/
/
-
See the corresponding README section in the Common Components Management GitHub repo ↩
-
There are a couple of other means available which are worth being considered. An advantage of the Common Components Management is that it also provides a VB-Project Synchronization and an automated update for Common Components when there is a more up-to-date version available. ↩
-
I myself keep Workbooks/VB-Projects in a dedicated Workbook folder already for a long time. The folder has a sub-folder which keeps the Export-Files of all changed VB-Components, whereby this export is automatically managed by a Common Component Management Service][1]. This dedicated Export-folder not only serves as a backup in case the VB-Project gets corrupted (a true godsend in case) but is also the source for a versioning provided by [_GitHub Desktop. ↩