I am looking for a version control system which I can use for the Code of VBA possibly in a form of add-in but similar to SVN or Git or even a commercial software. I know there is a discussion here and there however, they are older than 6 years and that is not exactly what I want to have. And I know one can use Tortoise SVN just for the code but not for the whole project (all modules of the code+tables) and I am aware of it that one can do it manually.
-
1What actual question are you looking to have answered? – Tim Biegeleisen Dec 20 '16 at 11:02
-
a possible version control system for Excel-VBA – maniA Dec 20 '16 at 11:10
-
1Well you've already named several. You can't expect to get recommendations for one over the other here. – Tim Biegeleisen Dec 20 '16 at 11:11
-
@TimBiegeleisen :) you may be right, but probably there is still a possibility which I do not know, because I am not an expert according VBA programming – maniA Dec 20 '16 at 11:13
-
2The VCS tool one chooses isn't highly dependent in the language AFAIK, unless maybe you are looking for special integration. Personally, I'd go with Git. – Tim Biegeleisen Dec 20 '16 at 11:15
-
1Git integrated? wau ok! How is it possible? It seems to be what I want – maniA Dec 20 '16 at 11:17
-
1Try using a Git tutorial. If you get stuck at a particular spot, then come back here with a focused question. – Tim Biegeleisen Dec 20 '16 at 11:22
2 Answers
NOTE: This feature has since been removed. Rubberduck still allows exporting all code files from a VBA project to the file system, but as of 2019/02/08 while it allows importing all code files at once, it will not overwrite existing modules on import, which makes this answer pretty much invalid.
Disclaimer: I'm a contributor on the Rubberduck VBA project.
The Rubberduck VBA add-in for the VBE, adds a number of features, including Source Control for all VBA hosts. It's actively developed, open source and free, and works in all versions of Excel (and Access, and Word, and PowerPoint, etc) from Excel 2000 onwards, and in 32 and 64-bit versions of Office
Rubberduck uses the LibGit2Sharp library, so you can integrate directly with GitHub and other cloud based services, or you can simply export modules and forms to a folder.
You can find the project on GitHub here: https://github.com/rubberduck-vba/Rubberduck

- 69,817
- 8
- 107
- 235

- 9,352
- 2
- 29
- 60
-
2Alternatively, you can run a Python script as part of your git pre-commit hook to automatically extract your VBA modules and add it to your commit as explained here https://www.xltrail.com/blog/auto-export-vba-commit-hook – Bjoern Stiel Dec 01 '17 at 11:16
I don't think there are any compelling source control systems targeting Excel VBA, you'll just have to pick one of the names you already have and adapt it for Excel VBA.
So, I most recently used (and would still choose) GIT but I had/have to export the modules out to a directory. Other Enterprise Level Excel systems I've worked on have similarly export modules and versioned those separately.
As for the sheets they typically were housed as a binary file; only on one occasion did I work on a system that stored the sheet logic that lent itself to source control version comparison, it was a custom Xml format.
Interestingly, the latest Excel file formats format of xlsm and xslx are in fact zip directories of sheet logic atomised. I've looked into this file format and it does not lend itself very well to being version by source control. I think Microsoft missed a trick here.

- 8,050
- 3
- 34
- 65