Compare excel files(ExcelObj is undefined )
I'm trying to compare two excel files using below code, I'm getting error 'ExcelObj' is undefined'. Please help...
Thanks :)
function Excel()
{
var oExcel = Sys.OleObject("Excel.Application");
var aSheets = Sys.OleObject("Scripting.Dictionary");
//You can specify the sheet to be compared
//var vSheet = "Sheet1";
//aSheets.Add(vSheet, vSheet);
var fileName = "C:\\Users\\ghaniabd\\Desktop\\excel";
var aInfo1 = aSheets.CreateInfo(oExcel, "1.xlsx", "Aging Summary (01 1 2017 - 03 1");
var fileName = "C:\\Users\\ghaniabd\\Desktop\\excel";
var aInfo2 = aSheets.CreateInfo(oExcel, "2.xlsx", "Aging Summary (01 1 2017 - 03 1");
var oResult = aSheets.Compare(aInfo1, aInfo2);
if (oResult.length > 0)
{
Log.Warning(oResult);
}
else
{
Log.Message("The files are the same.");
}
oExcel.Quit();
}