Error 5 if spreadsheet hasn't been saved
Performs a cell-by-cell comparison of Excel Worksheets.
Brought to you by:
stevetowner
Error 5 (Invalid procedure call or argument) in procedure ReportName of Module mdlCompare (twice)
and
Error 5 (Invalid procedure call or argument) in procedure MergedDiffsName of Form frmMain (twice)
When one of the spreadsheets has not been saved, and is named something like Book5. The code assumes that the file name will have a dot in it, and chokes if there isn't, though after clicking through the error messages, it will work correctly.
I would suggest changing the code, for instance in ReportName of Module mdlCompare, to something like:
Dim OldDot As Integer
OldDot = InStrRev(OldWorkbook.Name, ".")
If OldDot = 0 Then
OldDot = Len(OldWorkbook.Name) + 1
End If
sOldWorkbookFilename = Left(OldWorkbook.Name, OldDot - 1)
and making similar changes for all other references to the dot of the filename.
Thanks. Will be fixed in the next version.
Steve