Forum Discussion
gid_216
12 years agoFrequent Contributor
Hi,
the number of rows to skip or the number of row to start can be passed as a parameter to the function responsible for comparision. if there is no separate function, create a function specific to this comparision and use that in you framework.
E.g.
Function fn_ExcelCompare(strFileName, strSheetName, intRowToSkip)
'For Excel COM
'*******************************************************************
'Create Excel object, Open workbook, worksheet
'Get the Used range row and column.
For intCounter = intRowtoSkip + 1 To intRowCount
'''TODO Script
Next
'*******************************************************************
'For DDT ExcelDriver
'*******************************************************************
'Open ExcelDriver
objExcelDriver.First
While intRowToSkip > 0 'If the number of rows to skip includes first row of excel then replace 0 with 1
objExcelDriver.Next
intRowToSkip = intRowToSkip - 1
Wend
'Start comparision using DDT driver
End Function
This is to compare a single file with a reference. As you are comparing to excels, in the function, create two object for each file and compare. The parameter will get change in this case. Parameters will be two excel files and two sheet names (it can be one sheetname if both the file contains same sheet)
Hope this will help.
the number of rows to skip or the number of row to start can be passed as a parameter to the function responsible for comparision. if there is no separate function, create a function specific to this comparision and use that in you framework.
E.g.
Function fn_ExcelCompare(strFileName, strSheetName, intRowToSkip)
'For Excel COM
'*******************************************************************
'Create Excel object, Open workbook, worksheet
'Get the Used range row and column.
For intCounter = intRowtoSkip + 1 To intRowCount
'''TODO Script
Next
'*******************************************************************
'For DDT ExcelDriver
'*******************************************************************
'Open ExcelDriver
objExcelDriver.First
While intRowToSkip > 0 'If the number of rows to skip includes first row of excel then replace 0 with 1
objExcelDriver.Next
intRowToSkip = intRowToSkip - 1
Wend
'Start comparision using DDT driver
End Function
This is to compare a single file with a reference. As you are comparing to excels, in the function, create two object for each file and compare. The parameter will get change in this case. Parameters will be two excel files and two sheet names (it can be one sheetname if both the file contains same sheet)
Hope this will help.