How to Compare the 2 xl-sheets in QTP? ple write the vb
Script for the comparison?



How to Compare the 2 xl-sheets in QTP? ple write the vb Script for the comparison?..

Answer / rentalavdml

Set objExcel = CreateObject("EXCEL.APPLICATION")
objExcel.Visible = True
Set objWorkbook1= objExcel.Workbooks.Open("C:\Documents and
Settings\user\Desktop\sriya1.xls")
Set objWorkbook2= objExcel.Workbooks.Open("C:\Documents and
Settings\user\Desktop\sriya2.xls")
Set objWorksheet1= objWorkbook1.Worksheets(1)
Set objWorksheet2= objWorkbook2.Worksheets(1)
For Each cell In objWorksheet1.UsedRange
If cell.Value <> objWorksheet2.Range
(cell.Address).Value Then
cell.Interior.ColorIndex = 3
'Highlights in red color if any changes in cells
Else
cell.Interior.ColorIndex = 0
End If
Next
set objExcel=nothing

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More QTP Interview Questions

Suppose there is a bitmap with some text in it how do you write the script to get the text.

2 Answers   BirlaSoft,


hi guys, could you please prepare script for given format ? 1,1,2,3,5,8,13,21,...etc use vbscript for this...?

2 Answers   Value Labs,


Wat is the command used to add an object(properties) to an object repository?

2 Answers   Virtusa,


What criteria do you use when determining when to automate a test or leave it manual?

2 Answers  


Differences between quicktest professional (qtp) and winrunner?

0 Answers  






what is supply chain management?

0 Answers   ITC Infotech,


What is debugging? How you debug your script?

0 Answers  


Can anyone tell me about "Step- By Step Paramterization". among the two paramaterizations, Step by step and Parameterize All, which one is mostly used.

0 Answers  


Why bpt?

0 Answers  


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format, as i'm not in a possition to afford any 'Fee' to join in any institutions. Hence, if possible, kinldy mail PDF file to my mail-ID: chakri_avala@yahoo.co.in Regards, Chakradhar Yadav.

95 Answers   Cap Gemini, Citrix, CTS, IBM, Logistics, QA InfoTech,


I have to pass all the test cases into gmail userid and password using functions please give me code thanks have anice and greate day

2 Answers  


Think and Reply.. can we parameterize radio buttons, check boxes? as in flight web site on flight preference page, choosing different flight produces trouble if from port and to port been parameterize, and runs. Try it by own you will get the error.

3 Answers   Patni,


Categories