Dim ExcelSheet
Set ExcelSheet = CreateObject("Excel.Application")
excelsheet.application.visible = true
ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column
A, row 1"
' Save the sheet.
ExcelSheet.SaveAs "C:\DOCS\TEST.XLS"
' Close Excel with the Quit method on the Application
object.
ExcelSheet.Application.Quit

after run this script i am getting error"The test cannot
continue due to unrecoverable error"

Answer Posted / nani

Hi try this one:

Set ExcelObj=CreateObject ("Excel.Application")

ExcelObj.WorkBooks.Add

Set NewSheet=ExcelObj.Sheets.Item(1)

NewSheet.Name="Nagendar"

ExcelObj.Cells(1, 1).Value = "Number1"
ExcelObj.Cells(1, 2).Value = "Number2"
ExcelObj.Cells(2, 1).Value = "23"
ExcelObj.Cells(2, 2).Value = "53"
ExcelObj.Cells(3, 1).Value = "63"
ExcelObj.Cells(3, 2).Value = "33"

ExcelObj.ActiveWorkbook.SaveAs "c:\test1.xls"


ExcelObj.Quit
Set ExcelObj = Nothing

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to find the path of folder in which the test is saved in qtp?

534


Dear All , For UFT 12.02 which version QC or ALM will support ? Thanks Balaji

927


Hi, I am working on microsoft infopath forms..It is standalone form..(not dotnet or web.) . I am not able to indentify any objects in it.. I am currently using active accessibility in the macro for the same but its execution is too slow.. Kindly help in case you have better solution.

2411


What are the five challenges you faced in QTP?

2755


1. What is the difference between Keyword and function in the keyword driven framework? 2. How do you associate Keywords to the script ?

991






What is test object model in quicktest professional?

628


Can we write winrunner language i.e TSL in QTP tool?

1479


.have you ever written compiled module? if yes , tell me about some of the function that you wrote.

1684


Difference between copy to action and call to action?

594


How to add object to object repository in qtp9.0 Suppose for brower yahoo home page

1433


How can I use Call dlls in QTP ?

1794


can i compare two databases using QTP ?

1887


Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link

870


How to use the object spy in quicktest professional (qtp) 8.0 version?

516


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

562