maia
14 years agoNew Contributor
Problems with function Compare
Hello, i am having a problem with my code:
Sub Main
Dim oExcel,oExcel2, aSheets, vSheet, fileName, aInfo1, aInfo2
Set oExcel = Sys.OleObject("Excel.Application")
Set oExcel2 = Sys.OleObject("Excel.Application")
Set aSheets = Sys.OleObject("Scripting.Dictionary")
'You can specify the sheet to be compared
'vSheet = "Sheet1"
'Call aSheets.Add(vSheet, vSheet)
fileName = "c:\massa_teste.xls"
Set aInfo1 = ExcelObj.CreateInfo(oExcel, fileName, aSheets)
fileName2 = "c:\resultado.xls"
Set aInfo2 = ExcelObj.CreateInfo(oExcel, fileName2, aSheets)
set oResult = oExcel.Compare(aInfo1, aInfo2)
If Len(oResult) > 0 Then
Log.Warning oResult
Else
Log.Message "The files are the same."
End If
oExcel.Quit
End Sub
The object does not support this property or method: 'o.Excel.Compare'.
Sub Main
Dim oExcel,oExcel2, aSheets, vSheet, fileName, aInfo1, aInfo2
Set oExcel = Sys.OleObject("Excel.Application")
Set oExcel2 = Sys.OleObject("Excel.Application")
Set aSheets = Sys.OleObject("Scripting.Dictionary")
'You can specify the sheet to be compared
'vSheet = "Sheet1"
'Call aSheets.Add(vSheet, vSheet)
fileName = "c:\massa_teste.xls"
Set aInfo1 = ExcelObj.CreateInfo(oExcel, fileName, aSheets)
fileName2 = "c:\resultado.xls"
Set aInfo2 = ExcelObj.CreateInfo(oExcel, fileName2, aSheets)
set oResult = oExcel.Compare(aInfo1, aInfo2)
If Len(oResult) > 0 Then
Log.Warning oResult
Else
Log.Message "The files are the same."
End If
oExcel.Quit
End Sub
The object does not support this property or method: 'o.Excel.Compare'.