how to compare two excell sheets by using vbscript??

Answer Posted / deven

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook1= objExcel.Workbooks.Open("E:\Deven1.xls")
Set objWorkbook2= objExcel.Workbooks.Open("E:\Deven2.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
msgbox "value is different"
Else
msgbox "value is same"
End If
Next
objWorkbook1.close
objWorkbook2.close
objExcel.quit
set objExcel=nothing

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Have you used xml check point in your project? How?

767


what is the difference btn risks & Therads in the Test plan documentation?

1882


Explain how qtp identifies objects?

792


Explain features of the latest version of qtp/ uft 12.1?

837


How to use debug tools?

2449


Explain the views in the QTP GUI?

807


In qtp, explain what is keyword driven automation framework?

848


write a script for allinterview-submit Question first we've to select Choose Category,second select Sub- Category(Which is comes in to runtime)third select Question Type.for that give some descriptive and vb script

1603


what is clean sweep?

2065


How is the Bitmap checkpoint different from Image checkpoint?

843


What is ‘object spy’ and what is the function of object spy in qtp?

783


How to use the object spy in quicktest professional (qtp) 8.0 version?

743


How to capture dynamic values in load runner and how Each of the captured values are to be written to a text file (c:\temp\LoadRunner1.txt)

1990


In qtp, explain what is qrs file?

807


How many types of run modes are there in qtp?

812