Microsoft Office VBA code is usually held in binary format, making proper version control difficult. VBA Sync synchronizes macros between a VBA-enabled file and a folder, enabling easy version control using Git, SVN, Mercurial, or any other VCS.
I no longer maintain this project. I have released it into the public domain.
VBA Sync works directly with the Office file, unlike most other solutions, which use a host application (e.g., Excel) to manipulate the VBA code. This gives it several advantages:
VBA Sync has two modes: Extract mode extracts modules from the file into the folder. You can then commit the extracted files to version control. Publish mode publishes modules from the folder into the file. You should do this after merges.
After you select a mode, a folder path, and a file path, the tool will list which modules have changed, with a checkbox next to each. Tick the checkbox next to each module with changes you'd like to apply. Double-click an entry to run a diff tool against the old and new files. (This requires setting up a diff tool under File→Settings.) If the underlying files change, click Refresh. When you're ready to synchronize, click Apply or OK.
You can save and load session settings from the File menu. Settings
are saved as
.ini files. If a settings file is named
and located in the working directory, VBA Sync will load those
settings automatically. I recommend taking advantage of this and
launching VBA Sync from a shortcut with the working directory overridden,
to avoid having to specify the folder and file each time you need to synchronize.
You can also specify settings on the command-line via switches:
||Extract VBA from Office file (default)|
||Publish VBA to Office file|
||Specify Office file|
||Specify version-control directory|
||Do the selected action, then immediately exit (required on Linux/Mac)|
||Ignore empty modules|
||Search subdirectories of version-control directory|
||Allow adding new document modules when publishing (expert option)|
||Allow deleting document modules when publishing (expert option)|
Any other parameter passed to VBA Sync will be read and parsed as a session
Created 2017 by Chelsea Hughes
Thanks to GitHub user hectorticoli for the French translation.
I release all rights to this work. You may use it for any purpose, and alter and redistribute it freely. If you use this in another product, credit would be appreciated but is not required.
This software is provided “as-is,” without any express or implied warranty. In no event will I or any other contributor be held liable for any damages arising from the use of this software.