
You can now select one of your new directories as “Right”, and the other as “Left”. Open the WinMerge program and select “Open…” from the file menu.Repeat the prior step for the other Excel project.Note that each module (and possibly sheet, if it contains code) will be exported into a separate file. The third tab of the dialog lets you choose where to export the VBA text files. Note that you can export the VBA code without having to actually “clean” the project (specify this on the second tab of the Clean Project dialog box). Select the “Clean Project…” command from the Tools menu and export the Visual Basic Code to one of your new directories.

VISUAL STUDIO 2019 COMPARE TWO FILES INSTALL
If you don’t have it installed already, download and install the VBA Code Cleaner Excel add-in.Download and install WinMerge, a free utility for comparing text files.

The process is roughly as follows: (Note: I have not tested these directions are perfect, but they are pretty close) Thanks in advance for any help.įor reference of future posters/searchers, here is a method I used for comparing Visual Basic code that exist in separate Excel workbooks. I realize I've got a lot of questions here. Does anyone know of a utility that allows you to export the entire set of VBA code from a workbook into a single text file? That way I could do one large comparison rather than many smaller comparisons. If I use the text file method, then I (apparently) have to export each module separately. Does anyone recommend a text-file comparison utility that would be suitable? Has anyone used it?īarring this tool, I can export the code to a text file and compare that way.
VISUAL STUDIO 2019 COMPARE TWO FILES SOFTWARE
I've seen a piece of old software called VBA Code Compare, but development on this product apparently ended in 2006 with Excel 2003.

I know that you can do it by hand, by opening both files and putting the module windows side-by-side in the VBE, but it's tedious.Īre there any VB tools or VBE extensions that will do it automatically? I got in a position where I have two files containing nearly-identical VBA code, and I need to determine (and aggregate) the differences. Do any Excel pros out there have a preferred method of comparing the code in two VBA modules to determine the differences (e.g., code from two separate Excel files, such as two versions of the same workbook)?
