how to compare two excell sheets by using vbscript??

Answers were Sorted based on User's Feedback



how to compare two excell sheets by using vbscript??..

Answer / 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

how to compare two excell sheets by using vbscript??..

Answer / 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

More QTP Interview Questions

I want to learn QTP Online, where can I get quality training?

15 Answers   CSC,


in process of project exaplnation the defects are says frequently r not?

1 Answers  


How many test scripts are prapare in ur project(HeathCare Insurance).

1 Answers   Virtusa,


how will u choose a tool for test automation ?

1 Answers  


What are parameterizing tests?

0 Answers  






Why you are Using Descriptive programming instead of Object Repository?

11 Answers  


how to write this script using descriptive programming? the script below is the script generated by QTP plz write the script using descriptive programming? plzzzzzzzz do answer thanku Browser("Welcome: Mercury Tours").Page("orkut - login").WebEdit("Email").Set "test123" Browser("Welcome: Mercury Tours").Page("orkut - login").WebEdit ("Passwd").SetSecure "475259b450e3d212bef4a5f5ce9d32ebcbf4" Browser("Welcome: Mercury Tours").Page("orkut - login").WebButton("Sign in").Click Browser("Welcome: Mercury Tours").Page("orkut - home").Link ("Logout").Click Browser("Welcome: Mercury Tours").Page("orkut - login").Sync Browser("Welcome: Mercury Tours").Close

3 Answers  


i want to learn testing tools what i have to know before.iam fresher i dnt know any this..which langagues i have to before testing.

2 Answers   Wipro,


What are the features of quick test pro(qtp)?

0 Answers  


How to automate the windows dialog box which is coming in the run mode? Whenever I run my scripts,I am getting dialog box ( for ex: Pls enter zipcode" eventhough I already entered the value,the dialog box pops up).I need to click it. Pls give some idea-How to automate the dialog box which is pop up in the runtime.

2 Answers  


What is the life cycle of QTP? Pls Give me Exact answer?

6 Answers   Google,


How does QTP identifies the object in the application Mainly objectives are three type's OF PROPERTIES namely

3 Answers  


Categories