how to compare two excell sheets by using vbscript??
Answers were Sorted based on User's Feedback
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 |
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 |
What are the data types in qtp?
How to start recording using quicktest professional (qtp)?
What are the differences between table and db checkpoints?
1)what is the Exact Meaning of Environment Variables? 2)what is Compile Module in QTP? what exactly it contains Functions or Actions?
What is checkpoints for quicktest professional (qtp)?
what is syncurnisation point? what is the use of this in real time environment? plz explain?
If I change the property value at runtime is it effect is object repository?
can i compare two databases using QTP ?
pls tell me different type of automation frame works in QTP and which one need to select in client server application
How QTP support all types of applications (platforms)?
how can we preform retesting(DATA driven test) using function please gine the code for loginpage
how do u retrieve data from a database ? i.e. i want to retrieve 2nd record only from a database ? write code for this. by using ADODB connecton, RSOBJ and using a FOR loop we can retrieve all the records( ex: if we give query as select * from emp). but i want only 2nd record. so how to acheive this.