QTP : Inserting a text into a cell of an excel sheet

What will be the script to insert a text or value into a cell of an excel sheet ? Pls help...Thanks in advance.

Questions by cyber_coolie

Showing Answers 1 - 6 of 6 Answers

The following code will be useful for inserting text into excel.

Dim app
Dim book
Dim sheet
Set app=CreateObject("Excel.Application")
Set book=app.workbooks.open("e:temp.xls")
Set sheet=book.activesheet
sheet.cells(1,1)="hello"
book.save
app.quit

  Was this answer useful?  Yes

kotike

  • Apr 12th, 2010
 

set oExcel=CreateObject("Excel.Application")
set oWB=oExcel.WorkBooks.Add
oExcel.visible=True
oExcel.Cells(1,1)="All the Best.have a great day"
set oWB=Nothing
set oExcel=Nothing

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions