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
Explain how qtp identifies objects?
what is meant by function library?Public and private functions in function library? if private functions are applicable for only for the particular test means then y we have to add those to function library?
how to acess a test in RSA?
What is quicktest professional?
What is the difference between shared and local object repository?
Can you list some technologies that support qtp?
How many types of recording modes in qtp? Which will be used when?
What is test object?
Can I change properties of a test object?
Explain the features of quick test pro(qtp)?
What is Unicode Compatibility?
Is there any pdf or online book for QTP Scripting? Let me know more about QTP Scripting.
Why we load add-ins in qtp?
can test automation improve test effectiveness?
Explain the types of object repository?