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 can you do retesting (datadriven test) using notepad amd by using functions NOTE u should not use datatable methods
what is test scheduleling?
What is the extension of the recovery scenario file in qtp?
Differentiate the type of test cases which can be automated and which cannot be automated?
What are the differences between quicktest professional and winrunner?
i need code for how to click on particular mail in utlook mail box .its urjent Thank You Balaji
What are the check points can be inserted without recording?
Define object spy ?
What are the key points to create a framework in QTP for oracle forms?
How to capture all the data of a webtable, weblist and combolist using QTP?
if our qtp vb Script may be Currepted then What we want do?
Explain advantages and disadvantages of ddf?
How many add-ins comes by default with qtp?
what type of automation is follwed in the project?
How would you export a script from one pc to another in qtp?