Invoking DiffEngineX From Your Software

Invoking DiffEngineX - Compare Excel Spreadsheets - From Software

Although DiffEngineX is not currently exposed as a COM component or DLL class library, it is possible to invoke DiffEngineX programmatically from software, as well as from the Windows Command Prompt. DiffEngineX can be driven by command line arguments. A full list of arguments is given in the help file available from the DiffEngineX menu item Help-->Help Topics-->Command Line Arguments. The list is also available on our Internet help page.

A snippet of C# .NET source code showing how to do this is given below. Although the string assigned to .Arguments has been split across several lines here, ensure that your code is on a single one.

(The /outbook1 and /outbook2 arguments are optional, if you don't want to save the DiffEngineX created reports to your filesystem. As /show has been used, the /report argument is also optional in the example below. Note that meaningful exit codes are only available from version 2.16.)

namespace CallDiffEngineXExample
private void CallDiffEngineXProgrammatically1()
Process process = new Process();
string filename = @"C:\Program Files\Florencesoft\DiffEngineX\DiffEngineX.exe";
process.StartInfo.FileName = filename;
process.StartInfo.UseShellExecute = true;
process.StartInfo.Arguments = @"/inbook1:""C:\Users\Bob\test worksheets\original.xlsx""
/inbook2:""C:\Users\Bob\test worksheets\modified.xlsx""
int exitCode = process.ExitCode;