Exit Codes When Calling DiffEngineX Programmatically

Version 2.16 of DiffEngineX now returns meaningful exit codes when called programmatically or from batch files. Only versions 2.22 and above return codes -5, -6 and -7.
| Exit Code | Description |
|---|---|
| Positive Integer | Number of worksheet cell differences |
| 0 | No worksheet cell differences found |
| -1 | General Error |
| -2 | Number of differences greater than maximum integer value |
| -3 | Workbooks could not be compared due to protected worksheets |
| -4 | Workbooks are different, at least, because of unpaired worksheet names |
| -5 | Row or column alignment has failed |
| -6 | Visual Basic difference report could not be displayed in a web browser |
| -7 | Visual Basic difference report could not be output |
Note: Only worksheet cell differences are included in the exit code. Defined name, comment and VBA macro differences are not included.
A sample batch file (*.bat) testing the exit code is given below.
@echo off
del r.xlsx
"C:\Program Files\Florencesoft\DiffEngineX\DiffEngineX" /inbook1:"a.xlsx" /inbook2:"b.xlsx" /report:r.xlsx
@if "%ERRORLEVEL%" == "0" goto good
:fail
echo Workbooks are different or error occurred
echo return value = %ERRORLEVEL%
goto end
:good
echo Workbooks have no cell differences
echo return value = %ERRORLEVEL%
goto end
:end
