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

What is ObjectParamater?

1781


Hi All, we are using QTP Automation Scripts to test SAP. I recorded QTP Automation Scripts in English-based SAP GUI. Now we have to test a French-based SAP sytem and use the same scripts. The QTP scripts are failing when executed on the French-based SAP System due to Object Recognition Issues. What can we do? Do I re-record the scripts in the French-based SAP system?

2565


I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.

1761


I used child objects to get the no of weblist present in the weblist.now i need to select the items present in each weblist ?How to do so

2458


Can anybody post some real time scenario in qtp? please its very urgent.

2034


What is keyword driven framework?

838


How to associate function library at a run time?

899


How do you send email with attachment from outlook using qtp ?

764


Hi, My name is kishan. I have good Conceptual Knowledge on QTP. In order to Boost up my Confidence Level, I want to do a Project oriented Training only on QTP in Hyderabad. Kindly Let me know which is the Best QTP Project Training Institute in Hyderabad. Thanks in Advance kishan

2282


How to run a test using quicktest professional?

723


Explain xml checkpoints.

843


hi nani my doubt is how does qtp process metrix related to software process.

1759


Can any suggest me what is exposure testing?

1562


How does quicktest professional identifies the object in the application?

762


What is the expert view?

764