Working with Excel

If I ask you to tell about Microsoft Excel. What can you think of? It is an excel workbook which contains sheets, cells, table like structure  where we write data , read data etc.

Same operations, we can perform through coding. We need to create sheet,delete sheet, read data , write data,compare data etc.

As a first point, we need to create an excel object instance using method ‘createobject’. Let’s learn how to perform all these operations.

Creating an Excel workbook and save it at any location :

Open an existing excel and rename its first sheet:

Open an existing excel and write some data in the renamed sheet:


Count the no. of rows and columns in excel sheet:

Total rows are 3 Total columns are 2

Read data from excel sheet:

Delete the sheet:

Compare data between 2 excel sheets:


Note: Note:
we should close the workbook and excel instance after use. Otherwise, instance will not be close and on next run program will throw an error that sheet already opened.
All about loop in UFT
Conditional statements
Shekhar Sharma

Shekhar Sharma

Shekhar Sharma is founder of This website is his window to the world. He believes that ,"Knowledge increases by sharing but not by saving".

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *