Click here to Skip to main content
15,668,842 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to give arguments to Spreadsheet Compare App through command line.
I also want result of comparison in excel file as output.
Is there any way of doing this? Is there any possibility of doing this through VBS?

What I have tried:

I have searched on web and found below code: However this code is not giving any output file. It is showing result in Spreadsheet compare tool itself. Another drwaback is that it is picking up any first two files of whatever format (for eg.pdf) or any other and comparing it.

@ECHO Comparing two files:
@ECHO 1: %1
@ECHO 2: %2

dir %1 /B /S > temp.txt
dir %2 /B /S >> temp.txt

"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office Tools\Spreadsheet Compare.lnk" "temp.txt"

Updated 21-Jul-22 20:16pm
Richard MacCutchan 22-Jul-22 3:37am    
Change your dir commands so they list only Excel files.
Keyur Raval 2022 22-Jul-22 6:38am    
How to do that?
Richard MacCutchan 22-Jul-22 6:55am    
dir %1/*.xlsx /B /S > temp.txt
dir %2/*.xlsx /B /S >> temp.txt

If you type "dir /?" at a command prompt you can see all the options.

1 solution

Share this answer
Keyur Raval 2022 22-Jul-22 3:28am    
It is not working ... I have mentioned this code in "What I have tried:" section.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900