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
Pls can anybody send me the Recent Technical and Interview Questions Which were asked in IBM(QTP)Automation PLZZZZZZZZZ
How to execute a winrunner script in quicktest professional (qtp)?
Can we call qtp test from another test using scripting. Suppose there are 4 tests and I want to call these tests in a main script. Is this possible in qtp?
HOw to add the recovery file at runtime to the test file .
in a web page hoe to check the dynamic links that rechabging with out using regular expressions
What is the use of an object spy tool in qtp?
What are metrics and matrix?
Could you please any one give code for the following ? Scenario : Suppose a excel file contains 10 records and earch have 5 fields. how can i input this excel file for datadrive wizard ? Please explain
Which environments are supported by hp qtp?
When and why to use descriptive programming?
How will you report the bug and explain the defect tracking sheet you handled?
What is use of object spy?
what QTP Options do you know?
What is action split and the purpose of using this in qtp?
Explain about business process component? types and usage?