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"
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / dipti
Dim ExcelSheet, excelobj
Set ExcelObj = CreateObject("Excel.Application")
excelObj.visible = true
ExcelObj.Workbooks.Add
Set ExcelSheet = ExcelObj.Sheets.Item(1)
ExcelSheet.Cells(1,1).Value = "This is column A, row 1"
' Save the sheet.
ExcelObj.ActiveWorkBook.SaveAs "C:\TEST.XLS"
' Close Excel with the Quit method on the Application
' object.
ExcelObj.Quit
Set excelobj = nothing
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / abhishek
hi friends
Try this code. it must work.
setexcel=createobject("excel.application")
setexcelsheet=createobject("excel.sheet")
excelsheet.application.visible=true
excel.activesheet.cells(1,1).value=1111
excel.activesheet.cells(1,2).value=2222
excel.activesheet.cells(2,1).value=1111
excel.activesheet.cells(2,2).value="aaaa"
excelsheet.saveas "c:\xyz.xls"
| Is This Answer Correct ? | 4 Yes | 6 No |
How many actions we can write in a test?
How to pass parameters to Actions Pls anybody can give the answer.. Thanks in advance...
Can the user toggle between using Local OR and shared OR for the same action?
What are the different attributes used with regular expression?
I need to obtain the parent of an object programatically, so if I have: winButton("aButton") I need to obtain the parent part: window("Window1").Dialog("Dialog1") so I can programatically create a string of the full name of the object to call it with an execute statement in QTP I would like to use something like: part[1] = "window(""Window1"")" part[2] = "dialog(""Dialog1"")" so I can do: exeLine = part[1]&"."&part[2]&"."&"winButton(""aButton"")" Execute exeLine Apart from keeping a record of the window/dialog hierarchy is there a parent or path function/ command Thanks Adrian
what are the utilities and drivers
How can we record an edit box in the Web application ?
WHAT IS THE USE OF "FUNCTION GENERATOR" IN QTP?
in which situation u will use recording and in which situation u will used to write script manually
What if recovery scenarios is also failed for identify the alert ? (We are handling unexpected popup through recovery scenarios but if still recovery scenarios also failed than what should be the approach)
Why bpt?
WHO IS THE BEST FACULTY FOR QTP IN HYDERABAD? A) NAGESHWAR RAO- MINDQ B) SURESH REDDY -SMART SOLUTIONS C) SURESH BABU- Q EDGE D) VENKAT - LIVE TECH E) GC.REDDY - HI-TECH CITY F) NONE OR OTHERS