Menu

#64 Error 5 if spreadsheet hasn't been saved

Current_Version
pending
nobody
None
1
2014-07-09
2014-07-01
ElrondPA
No

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.

Discussion

  • SteveT

    SteveT - 2014-07-09

    Thanks. Will be fixed in the next version.

    Steve

     
  • SteveT

    SteveT - 2014-07-09
    • status: open --> pending
     

Log in to post a comment.

MongoDB Logo MongoDB