Forum Discussion
Hi Robert,
Thank you for your quick reply. I changed the code to this:
function CompareExcel()
{
let Excel = getActiveXObject("Excel.Application");
let xlfile1 = "S:\\Software\\mytilney.xlsx";
let xlfile2 = "S:\\Software\\plan.xlsx";
let RowCount = Excel.ActiveSheet.UsedRange.Rows.Count;
let xlWorkbook1 = Excel.Workbooks.Open(xlfile1);
let xlWorkbook2 = Excel.Workbooks.Open(xlfile2);
for (let i = 1; i <= RowCount; i++) {
if (xlWorkbook1.Cells(i,1).Value === xlWorkbook2.Cells(i,1).Value) {
Log.Message("The files are the same."); }
};
Excel.Quit();
}
But when I run it I'm still getting the same error:
'TypeError: xlWorkbook1.Cells is not a function'
Thanks,
Ivett
It MIGHT be due to this.
https://support.smartbear.com/testcomplete/docs/scripting/specifics/javascript.html#indexedprops
- sonya_m4 years agoSmartBear Alumni (Retired)
Thank you for helping tristaanogre
Ivett_K , did you manage to solve this issue?
If you update to the latest TestComplete version (14.50), you can try using the new Excel support to implement this task. It does not even require Excel to be installed on the machine.
- Ivett_K4 years agoOccasional Contributor
Hi Sonya,
Thank you for your message.
We decided the leave comparing excel files for now as we did further analysis and came to the conclusion it would be far too complicated as the formatting is is completely different in the files we wanted to compare.
Thanks,
Ivett
Related Content
- 10 months agoLuukdb
- 9 years agoilovechiku
Recent Discussions
- 3 days agoAndiiiA
- 4 days agomegha_phophalia
Log functions
Solved4 days agoAurore