I am get rid of comparing two excel files in quick time using QTP. Now, I am facing another problem, If there are any additions/ deletions from expected to actual reports, I am not able to get the solution. Our BO reports should have Row names and Column names. The script should identify the rows/columns by their name and compare the same row/column in Actual report file instead of comparing cell by cell.
Assume that there are 4 rows in Expected report, and another row has been added to Actual in between row 3 and row 4. If I compare those two reports, it will do the comparison for the first two properly and then compare the third row of Expected with third row of actual. But actually the row 3 in second report has moved to 4th due to addition of new row. I want to compare row 3 of first report with the row 4 of second table. Anybody, can you please me out by giving some suggestions.
According to my understanding add two sheets to the run time datatable of the qtp and export the sheets that you wanna compare here you can do the comparision based on the columns available in the sheet.
I have done everything whatever you people suggested above. I am now able to identify the added/deleted rows from Expected to Actual. My question is, the script should proceed to compare the row values of the rows which are common in both the reports along with displaying the added/deleted rows. For that I need to get the row UsedRange of each row. I did get the entire worksheet UsedRange. But I am clueless in getting the single row UsedRange. Can you please suggest the step/keyword in getting the Row UsedRange? I have tried in this format: ExpObjectExcelApp.Worksheets(Counter).Cells(ActRow No(j), 17).UsedRange