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
How to find the path of folder in which the test is saved in qtp?
Dear All , For UFT 12.02 which version QC or ALM will support ? Thanks Balaji
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.
What are the five challenges you faced in QTP?
1. What is the difference between Keyword and function in the keyword driven framework? 2. How do you associate Keywords to the script ?
What is test object model in quicktest professional?
Can we write winrunner language i.e TSL in QTP tool?
.have you ever written compiled module? if yes , tell me about some of the function that you wrote.
Difference between copy to action and call to action?
How to add object to object repository in qtp9.0 Suppose for brower yahoo home page
How can I use Call dlls in QTP ?
can i compare two databases using QTP ?
Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link
How to use the object spy in quicktest professional (qtp) 8.0 version?
What are the benefits of quick test pro(qtp)?