how to compare two excell sheets by using vbscript??

Answer Posted / maruthi ram

Set objExcel = CreateObject("Excel.application")
objExcel.Visible = True
Set objWorkbook1 = objExcel.workbooks.open("D:\maruthi1.xls")
Set objWorkbook2 = objExcel.workbooks.open("D:\maruthi2.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 ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

any body plz send health care domain project to me with explanation any two modules on that project. mail_id: ranjith_99reddy@yahoo.co.in

3436


Hi, is it possible for recording shortcut key during record session? The application on which I am working is web based application. This application has several shortcut key associated with menu option. I have succesfully recorded all menu option but unable to record shortcut key.

1385


Do you know SQL? I know SQL but i don't have any experience...that's it..No more questions ...simply he said " you can leave for the day" ...guys prepare SQL Quires before attending interview in bank of america...

1313


I need to pull the data from the page which in row, column vice into excel sheet, how can it be done using QTP? eg: Name Dept xyz gdty i need the same data to be exported in excel sheet.

1719


Explain sub procedure of vbscript.

586






How to open a new test using quicktest professional (qtp)?

527


How to use setroproperty?

566


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

1401


What is the recovery scenario in qtp?

566


How to creating an output value using quicktest professional (qtp)?

564


Explain how to use QTP to check broken links on a page?

581


Difference between action & Reusable action?

683


How to use checkpoints in qtp ?

578


Is it possible to switch between recording modes during a test creation?

588


Hi could some one explan what is the use of the function Defination generator, And how to use the function defination generator.. Explan with the example..

1341