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 VBScript operators, functions, and statements do you use in QuickTest Professional?

2170


Hai anyone please "Explain about Framework in QTP?"

1621


What is file database?

1690


What are the benefits of qtp?

556


What is qtpro?

597






explain abt dyanamic changing object with example?

1899


X flies from Hyd to bangalore using different methods of transportation. write the test scenarios and test cases for this?

1505


Tell some commonly used Excel VBA functions?

603


How many types of run modes are there in qtp?

586


what is the difference between the modular framework and datadriven frame work

1913


Explain the concept of object repository & how qtp recognizes objects?

570


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s.

533


When to use shared and local object repository?

634


Describe the differences between functions and actions in UFT?

610


please any one can explain the keyword driven framework. with gmail example.

1629