5

Is it possible to automate the new Spreadsheet Compare tool of Office 2013 from a .NET application or a VSTO Excel add-in by embedding some Microsoft assemblies?

A similar question was asked for VBA programming and the response was no.

I managed to execute the application "C:\Program Files (x86)\Microsoft Office\Office15\DCF\SPREADSHEETCOMPARE.EXE" in command-line with a text file as input argument containing two workbooks paths in separate lines, but it would be easier to call a method directly from the code, as for the other functions of Excel.

Community
  • 1
  • 1
JulienVan
  • 881
  • 1
  • 11
  • 30

3 Answers3

2

I wrote a simple batch script that allows compare of two files from a command line. Please refer to github: https://github.com/kniklas/excomp for further details.

I hope it will help those who would like to automate process of excel comparison (e.g. to hook this for version control - diff - of excel files).

1

A sample code on how this could be implemented can be found at:

Calling SpreadsheetCompare from command line

Community
  • 1
  • 1
mercedes
  • 169
  • 1
  • 5
  • It would be better always brief the solution within the answer. Links can be changed/removed at any time. – Aviro Mar 11 '16 at 00:54
0

Unfortunately, these workarounds will not work if your spreadsheets are maintained in TFS and you want to configure SpreadsheetCompare.exe as a user tool.

Configuring the tool to be used for Compare requires that both filenames be passed in as command line arguments.

Michael J.
  • 349
  • 1
  • 10
  • Actually, I take this back. If I create a batch script as noted above and configure it as the tool, then I can use TFS to compare two versions of a spreadsheet – Michael J. Apr 02 '15 at 15:46