how to compare two excell sheets by using vbscript??

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create runtime property for an object?

1448


How will you handle java tree in qtp?

625


UFT 12.02 which ALM version will support

982


hi all can anyone explain how to write the code for finding the mandatory columns in table which are having (red*) (red Astrik)

1401


write a script to verify the image path(src property) of the images which are in web pages.

1807






How does you pass optional arguments in qtp?

565


Mention the different actions types of qtp.

575


Is the qtp course will help to create a virtual object?

1516


Can anyone pls tell me how to do action parameterization (input and output parameters) with respect to login window and insert order of flight reservation window in detail( pls give a clear step by step explanation with example) anyone please. Will be very thankful to u

1375


ACTUALLY I AM WORKING IN THE DISTRIBUTION DOMAIN.MY COMPANY IS PROVIDING DISTRIBUTION SOFTWARE FOR PHARMA AND FMCG DISTRIBUTORS.HERE I AM USING QTP 9.2.HERE IN MY APPLICATION WHILE RECORDING ONE WINDOW APPEARS.IN THAT I CAN SELECT THE ITEM OR NO NEED TO SELECT.BUT WHILE RUNNING THE SAME SCRIPT THE WINDOW MAY NOT APPEAR OR APPEAR.HOW TO WRITE SCRIPT FOR THIS

1526


How does quicktest professional (qtp) identifies the object in the application?

581


Tell me one scenario, the complex functionality you have automated in your project?

1475


What is active screen?

564


How you can decide which type of object repository you have to use?

701


On what document base Descriptive programming is written if build is not yet ready ?

873