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

I want to do QTP Certification what is the pattern of Question paper.

1965


Explain the difference between check point and output value?

731


Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance

1742


How to execute a winrunner script in quicktest professional (qtp)?

713


How to integrate the qualitycenter with qtp

1997


what is error and fault in terms of software quality?

1687


Hi,Sudhanandareddy plz forword framework and ppts for QTP to me. This is my mail id: ranjith_99reddy@yahoo.co.in (your contact number also)

2047


Can the user toggle between using Local OR and shared OR for the same action?

755


What is the difference between per-action and shared?

842


How the exception handling can be done using quicktest professional (qtp)?

775


assume i have few url link how will i dynamically call then using descriptive programming?

1813


What is the framework your company is following. What is the reason. Explain why key word driven frame work is chosen.

1875


What are the ordinal identifiers in web page?

855


we use a file extension .properties why is it used and where do we use it plz help me out with detailed explanation and navigation of how to use on the QTP 8.2?

1873


write the vb script for call to new action in qtp?

2037