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

What is the keyword view and expert view in qtp?

0 Answers  


Error handling

3 Answers   Wipro,


What is meant by Step generator?what is the use of this? we have 3 steps know there what r all those.? can u all pls give me clear idea of this

0 Answers  


what are the environment variables,how do you use them. give an example.

3 Answers   Polaris,


What is dynamic arrays

1 Answers   Patni,






Define virtual object?

0 Answers  


actuall wat my doubt is:while doin regression testin we enter all +ve & -ve data....system has to accept +ve and reject -ve data.in such case we get a popup window sayin that wrong entry...now i wan to overcome this popup window..how do i go further....plz explain.i tried thru rec.scenario but of no use.

1 Answers  


pls dont join MIndq nageshwar rao...Nageshwar rao sir didnt teach QTP indepth...he teach basics only...atleast he dont know about INSTR concept...this concept take min 30 min...buthe teach 3 min only...like this so many concepts are missing in class. IN CLASS ROOM NAGESHWAR RAO SIR HIPNATIZE THE STUDENTS....WITH OTHER ISSUES.. dont join... look other institutes...this is my personal openion share your comments thank u

1 Answers   Mind Q Systems,


how qtp handles customised object

1 Answers  


what is vmodel?advantages and disadvantages of vmodel?

0 Answers   AZTEC,


What do you to script when objects are removed from application?

0 Answers  


what is the framework followed by ur company in qtp

5 Answers   Ordain Solutions,


Categories