I have a tool I've automated that creates multiple spreadsheets from a file and the next addition to the process would be to use Spreadsheet Compare to get the differences between 2 of the files created, export the results, then modify the formatting of the resulting sheet. I have the code working to open Spreadsheet Compare but I don't know how to feed the file locations of the sheets to it correctly.
Based on this link and this link tried setting up 2 variables with the locations and joining them in one variable to enter in the shell() and also adding both variables in the shell() but neither worked. I can tell it is effecting the file load though since I gives me an error from Spreadsheet Compare that reads "Please specify 2 files to compare", which it did not when I was only opening the application without trying to feed it files.
As per FreeMan's suggestion, here is very format I have tried;
-C:\file1.xlsx C:\file2.xlsx
-"C:\file1.xlsx C:\file2.xlsx"
-"C:\file1.xlsx" "C:\file2.xlsx"
-'C:\file1.xlsx C:\file2.xlsx'
-'C:\file1.xlsx' 'C:\file2.xlsx'
-[C:\file1.xlsx C:\file2.xlsx]
-[C:\file1.xlsx] [C:\file2.xlsx]
-(C:\file1.xlsx C:\file2.xlsx)
-(C:\file1.xlsx) (C:\file2.xlsx)
-all of the above in a single variable (first method)
-all of the above split between 2 variables (second method)
-all of the above from run
-all of the above from run using a .txt file for the file locations
Sub tCompare()
Dim strRoboappPath As String, varProc As Variant
Dim strArg As String
Dim var1 As String
Dim var2 As String
var1 = "C:\file1.xlsx"
var2 = "C:\file2.xlsx"
On Error Resume Next
strRoboappPath = "C:\Program Files (x86)\Microsoft Office\Office15\DCF\SPREADSHEETCOMPARE.exe"
strArg = var1 + " " + var2
varProc = Shell("""" & strRoboappPath & """ """ & strArg & """") 'first method
varProc = Shell("""" & strRoboappPath & """ """ & var1 & """ """ & var2 & """") 'second method
End Sub
I'm looking for Spreadsheet Compare to open with both files already loaded.