How to script Excel 2013's Spreadsheet Compare?

帅比萌擦擦* 提交于 2019-11-28 21:33:00
JulienVan

I opened a similar question for automating the Spreadsheet Compare tool from a .NET application, but I haven't found any other way yet than executing it from command-line.

You can do this from your VBA add-in. All you need is to locate the executable file SPREADSHEETCOMPARE.EXE (usually in C:\Program Files (x86)\Microsoft Office\Office15\DCF) and to execute it in command-line with an instruction file as input argument.

This instruction file must be an ASCII file with the two Excel file paths to compare written in separate lines.

You can't.

VBA does not cover add'ins as in this case.

Spreadsheet compare is a 3rd party plugin which got swallowed by Microsoft.

If you need scriptable compare you can find those which do for each cell, for each row... kind of thing on the net.

mercedes
  1. Create a runCompare.cmd file:

    REM Execute from command line spreadsheetcompare.exe 
    REM 
    cd C:\Program Files (x86)\Microsoft Office 2013\Office15\DCF
    spreadsheetcompare.exe  C:\reportNames.txt
    
  2. In C:\reportNames.txt, save in the same line the .xlsx files you wish to compare:

    C:\fileA.xlsx C:\fileB.xlsx
    
  3. Execute runCompare.cmd.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!