Excel File Compare Command Line Parameters

How to use xlCompare from the command line to compare and merge your Excel Files

General Command Line Syntax

To simplify integration into other applications, xlCompare has command line parameteres, similar to other file comparison tools

Compare two Excel Files

xlCompare.exe [file1] [file2]

xlCompare.exe /mine:[file1] /base:[file2]

xlCompare.exe /1:[file1] /2:[file2]

Open 2 files - FILE1 (left workbook) and FILE2 (right workbook) in xlCompare, compare and display color-coded difference report

Three-way comparison for Excel Files

Compare two excel files with common base version

xlCompare.exe [file1] [file-base] [file2]

xlCompare.exe /mine:[file1] /base:[file-base] /their:[file2]

xlCompare.exe /1:[file1] /2:[file-base] /3:[file2]

Open 3 files - FILE1 (left excel file), FILE2 (right excel file) and their BASE version in xlCompare. Perform 3-way comparison for the selected workbooks and display comparison report with highlighted changes.

Additional Command Line Options:

Use these commands if the options specified above doesn't cover all your needs

If you need to perform more complex actions in your source control system, please, use the options below. With them you can test the changes made before committing your workbook. This should keep you safe from errors in data and formulas, which could produce a big lossed for your company. Make your commits risk-free!

/merge

Open workbooks and perform automatic merge. In case of conflicts merge operation fails and you get conflict list on the screen.

/console

Work in the console mode without interface.

/quit_on_close

Close the xlCompare application, after you exit from the comparison mode. This option is useful for using xlCompare as excel diff tool in other application. After you've finished working with comparison report the application is closed

/testConflicts

Test passed workbooks for possible conflicts in the merge operation.

/titleMine:[title string]

/title1:[title string]

Use this title instead of path to the FILE1 (left workbook). You can use this option in order to specify alternate path. When file was downloaded from repository into temporary folder, this option allows to display "readable" file name.

/titleBase:[title string]

/title2:[title string]

Use this title instead of path to the BASE workbook. You can use this option in order to specify alternate path. When file was downloaded from repository into temporary folder, this option allows to display "readable" file name.

/titleTheir:[title string]

/title3:[title string]

Use this title instead of path to the FILE2 (right workbook). You can use this option in order to specify alternate path. When file was downloaded from repository into temporary folder, this option allows to display "readable" file name.

/output:[file path]

After merge command is completed, results are saved in the file, specified in the file-path parameter.

/r:[report-file]

Save comparison report in the file, specified in the report-file parameter.

Batch Excel File Comparison

Use this mode to compare several excel files in one go and get the comparison report for all processed files. You can use it from the bat file or from any other application, that allows to call xlcomparator.
/batch
Use xlCompare in BATCH mode. In this mode application compares set of excel files passed to the input and saves diffrence report in the XLSX file (as output).
xlCompare expects following command line syntax:
xlCompare.exe /batch /console [file-path] /r:[report-file]
Where the file-path argument specifies path to workbook that contains list of compared pairs of excel files.
This could be:
  • XLSX file. First column on the first sheet contains left file, second column on the first sheet contains right file.
  • CSV or Text file. Every row must contain two excel files. In case of TXT file, values must be delimited with text file separator, selected in the xlCompare options.
Real example looks like this one:
xlCompare.exe /batch /console "c:\Invoices\2019\complete-list.xlsx" /r:"c:\Reports\invoice-report-2019.xlsx"
xlCompare.exe /batch /console [file-list-1] [file-list-2] /r:[report-file]
file-list-1 argument specifies list of the excel files to be compared on the left side.
file-list-2 argument specifies list of the excel files to be compared on the right side.
This could be:
  • XLSX file. First column on the first sheet contains path of the excel file to be compared.
  • CSV or Text file. Every row must contain path to excel file.
Real example looks like this one:
xlCompare.exe /batch /console "c:\Invoices\list-2018.xlsx" "c:\Invoices\list-2019.xlsx" /r:"c:\Reports\invoice-report-2019.xlsx"
In this case saved diffence report contains information about all processed files.

Example of the xlCompare command line

Use this command line to integrate xlCompare into the Tortoise SVN Tool:
"C:\Program Files\Spreadsheet Tools\xlCompare\xlCompare.exe" %mine %base /quit_on_close