Show changes of a commit in svn log:
As you can see, the cells with changes are indeed marked red — but THAT’S ALL.
There are 2 problems:
- if the workbook has multiple worksheets, you have to traverse all worksheets because you don’t know exactly which worksheets have been changed.
- if a worksheet has many rows (or many columns), you need to drag a long scroll bar to look for cells with changes.
What I have tried:
-
I did some google, many people say to use SPREADSHEETCOMPARE.exe, but I found that the latest version of Office has removed this feature.
-
I tried to modify the script that svn uses to handle excel compare:
mouse right click menu > TortoiseSVN > Settings > Diff Viewer > Advanced
.xlsx => wscript.exe “D:Program FilesTortoiseSVNDiff-Scriptsdiff-xls.js” %base %mine //E:javascript
var used_range_base = objBaseWorksheet.UsedRange;
var n_row_new = used_range_new.Rows.Count;
var n_col_new = used_range_new.Columns.Count;
var any_cell_diff = false;
for (var row = 1; row <= n_row_new; row++) {
for (var col = 1; col <= n_col_new; col++) {
if (used_range_new.Cells(row, col).value2 !== used_range_base.Cells(row, col).value2) {
objNewWorksheet.Tab.ColorIndex = 7; // if any cell changed, mark the sheet's tab
any_cell_diff = true;
break;
}
}
if (any_cell_diff) {
break;
}
}
This will indeed mark the modified worksheets:
BUT — I don’t know why, this algorithm is extremly slow…
So, finally my question is: