What version control systems have you used with MS Excel (2003/2007)? What would you recommend and Why? What limitations have you found with your top rated version control system?
To put this in perspective, here are a couple of use cases:
- version control for VBA modules
- more than one person is working on a Excel spreadsheet and they may be making changes to the same worksheet, which they want to merge and integrate. This worksheet may have formulae, data, charts etc
- the users are not too technical and the fewer version control systems used the better
- Space constraint is a consideration. Ideally only incremental changes are saved rather than the entire Excel spreadsheet.
I’ve just setup a spreadsheet that uses Bazaar, with manual checkin/out via TortiseBZR. Given that the topic helped me with the save portion, I wanted to post my solution here.
The solution for me was to create a spreadsheet that exports all modules on save, and removes and re-imports the modules on open. Yes, this could be potentially dangerous for converting existing spreadsheets.
This allows me to edit the macros in the modules via Emacs (yes, emacs) or natively in Excel, and commit my BZR repository after major changes. Because all the modules are text files, the standard diff-style commands in BZR work for my sources except the Excel file itself.
I’ve setup a directory for my BZR repository, X:\Data\MySheet. In the repo are MySheet.xls and one .vba file for each of my modules (ie: Module1Macros). In my spreadsheet I’ve added one module that is exempt from the export/import cycle called “VersionControl”. Each module to be exported and re-imported must end in “Macros”.
Contents of the “VersionControl” module:
Next, we have to setup event hooks for open / save to run these macros. In the code viewer, right click on “ThisWorkbook” and select “View Code”. You may have to pull down the select box at the top of the code window to change from “(General)” view to “Workbook” view.
Contents of “Workbook” view:
I’ll be settling into this workflow over the next few weeks, and I’ll post if I have any problems.
Thanks for sharing the VBComponent code!