Forum Discussion

jsc's avatar
jsc
Regular Contributor
10 years ago

Compare 2 Excel files

Hi all,

 

at the end of one of my tests I have to compare 2 excel files.

I tried FileCheckpoints, but they are not useful for excel. So I found the ExcelCompare script extension: http://support.smartbear.com/viewarticle/42199/

 

But this extension does not work at all for me. 

It uses about 300MB RAM and crashes each time without any result.

 

I call it like this:

objectExcel.ExcelCompare("C:\\tmp\\test1.xlsm","C:\\tmp\\test2.xlsm", "C:\\tmp\\test3.xlsm")

The size of these excel files is about 300 kb.

 

The problem occurs with Excel 2013 and Excel 2010.

What do I do wrong?

 

Is there any other way to easily compare 2 Excel files without coding the comparison from scratch?

 

Best regards,

Joachim

 

10 Replies

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor

    Line 96 (resBook.SaveAs resultFile) of the script throws an exception when attempting to save as .XLSM.

     

     

    Try:

    objectExcel.ExcelCompare("C:\\tmp\\test1.xlsm","C:\\tmp\\test2.xlsm", "C:\\tmp\\test3.xlsx")

     

  • jsc's avatar
    jsc
    Regular Contributor

    the comparison works, but there are two problems:

    1) TestComplete always logs an error: The EXCEL.EXE process crashed.

    2) performance: with my 300kb files the comparison took 2.5 minutes.

     

    like this (slow, instable) it's not really an option.

     

    edit:

    I saved as xlsx the last few tries, but it did not work as well.

    • jsc's avatar
      jsc
      Regular Contributor

      we are now scripting our own ExcelComparison

      (extracting sheets and comparing sheets)

      Performance is waaaaaaaaay better than the Script Extension.

      • Ryan_Moran's avatar
        Ryan_Moran
        Valued Contributor

        Yea I didn't dig too deep into it, but it certainly didn't look like the most efficient process ;).