VBA Diff Tool | Compare VBA Code and Forms in Excel files
xlCompare is a tool to compare VBA projects in the Excel files for differences. This VBA diff tool performs comprehensive comparison of your Excel files and gives you detailed color-coded report with highlighted changes. Rich set of options, command line mode, integration with GIT and SVN, 3-way comparison of VBA code makes xlCompare ultimate vba diff and merge tool for Excel developers.
Find changes in VBA Projects in the Excel files with xlCompare tool
VBA Diff Tool (xlCompare©) in the action
Compare VBA Code in Excel files
xlCompare compares VBA projects in the Excel files for differences. You get comprehensive report for the compared VBA code modules.
Compare VBA Forms in Excel files
xlCompare compared Forms and Controls in the VBA projects in the Excel files. If something was changed on the VBA Form, you will be pointed to this modification.
Merge changes in the VBA Code
How to merge changes in the VBA projects? Forget about it if you are using xlCompare. Armed with this tool you don't need to export your code and import it back. All merge operations are done in xlCompare. In a few clicks you will get your job done.
Benefits of the VBA Diff tool xlCompare
Unfortunately, Microsoft Excel doesn't offer an effective way to compare and merge VBA modules in the Excel files. For VBA developers this becomes a real pain to find differences and resolve them, if something in the VBA projects has been changed.
So, the typical procedure to compare VBA code looks like this:
- Export VBA module from file 1 into text file
- Export VBA module from file 2 into other text file
- Compare two text files using text comparison tool (or paste contents into Word and compare contents of two files)
- Analyze the differences in the text files
What about if your workbooks have 30 VBA modules in each file?
Imaging time spent to this job!
So, xlCompare is a perfect alternative to this method and gives you following advantages:
All you need is to drop your Excel files into xlCompare. One click and you get results on your screen!
xlCompare greatly minimize time you need to spend to compare VBA code. This tool can save you hours of working time. If you multiply this time difference on your hourly rate you will see value of this tool.
Merge VBA projects
xlCompare has all possible functions you need to merge VBA projects in your Excel files.
3-way Compare and Merge and VBA projects
xlCompare allows to compare 2 Excel files that have common base version. This it tool you can use to resolve merge conflicts.
GIT and SVN Integration
Use xlCompare as your diff and merge tool for version control systems, like GIT and SVN.
How to compare VBA Code in Excel file for differences
Below we've placed step-by-step instruction on how to compare two Excel files for differences in the VBA code.
- Drop your Excel files into xlCompare window from the Windows explorer.
After second file is dropped, xlCompare immediately gives you Comparison Wizard window. Comparison Wizard is a window where you can select pairs of compared worksheets, VBA modules and VBA forms.If your workbooks have similar structure - just click Compare button. Otherwise, select VBA tab and make sure that VBA modules are linked properly.Complete this Wizard by clicking Compare button.
Results from the compared VBA modules are on your screen
That's all you need to do. Just in a few simple clicks you get results on your screen.
Compare this procedure with the exporting VBA code, that was described above. xlCompare looks much more effective, right?
Merge VBA Code in Excel
Compare VBA code is just a part of the VBA diff process. Usually, you need to see the differences and merge the changes in VBA code after you've found them.
In case of you are going to do it yourself, be ready to export and import all the modules in your Excel files and spend a half of your working day, if you have really large workbook.
xlCompare gives you several options you can use to merge VBA code.
Merge specific lines in VBA code
- Select line you need to merge in the VBA Editor
- Click the check box before this line
You see that this line appears in the corresponding module.
That's all. If you save the Excel file right now - new VBA code will be saved.
Merge all lines in the VBA code module
- Click in the master module, that contains code to be copied and press Ctrl+A. This hotkey selects all lines in the editor.
- Click on the any of the checkboxes in this panel.
- All the code was copied into the other VBA project.
Save your Excel file to complete the operation.
Looks very simple and easy right?
Compare VBA Forms in Excel workbook
There are only two methods to compare VBA forms in your VBA projects:
- Use xlCompare
- Compare VBA Forms manually
Second method is just a wasting your time. It is very time-consuming work with high risk of error. So, we don't recommend it.
xlCompare compares VBA Forms as easy as VBA code
xlCompare has own Visual Basic Viewer that shows contents of the Visual Basic project, including all forms and controls. In the screenshot below you see structure of the Form, represented in the hierarchical tree form. You can browse all controls in the native way.
Look into the image below. xlCompare highlights controls that was added in one of the versions of the Form.
Using xlCompare with SVN\GIT tools
Most of the VBA developers use SVN\GIT tools for version controls. Version controls for VBA code task is important if you are working in the team environment and need to resolve editing conflicts regularly.
In this case, xlCompare is a must have tool for you. It can be used in the SVN\GIT environment as external diff viewer for Excel files. This allows you to compare and merge VBA code right in the xlCompare, without exporting it.
Visit this page to get more information on integration with SVN.
3-way Compare and Merge Tool for Excel Files
xlCompare is a tool that allows to compare 2 Excel files, that have common base version. This is called 3-way comparison.
If you are VBA developer, this is a must have option. xlCompare displays changes made in two different versions and allows to resolve merge conflicts.
In the modern development, where Visual Basic programs has thousands of lines of code, xlCompare saves a lot of time and became an ultimate VBA diff tool.
The screenshot below shows xlCompare in the 3-Files mode. We've compared 3 Excel files for differences and brings you this color coded report.
Modifications detected by xlCompare
- Changed lines of code
- Conflicts: lines modified in both concurrent versions of Excel file
- New lines of VBA code
- New functions
I have a question about xlCompare
Please, describe your question or inquery in the form below. We will be happy to respond you!