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



Dim ExcelSheet Set ExcelSheet = CreateObject("Excel.Application") excelsheet.application..

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

Dim ExcelSheet Set ExcelSheet = CreateObject("Excel.Application") excelsheet.application..

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

Dim ExcelSheet Set ExcelSheet = CreateObject("Excel.Application") excelsheet.application..

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

Post New Answer

More QTP Interview Questions

What are the types of Object Repository’s in QTP?

2 Answers   Crea,


Hai Friends this is Rajesh , Is there any Site or Blog that Video tutorials of Qtp that can be free downloadable to Pc. Friends if any body know that site or blog please send me because i'm really in need for that because i cannot affordMoney in learning Course in Institutes due to Financial Problem . So please Forward that Site or Blog which provides Downloadable Video Tutorials in Free to PC , As My Friend is having PC thru that I'm planning to learn. So Kindly help me Friends if you are aware of that Site/Blog

2 Answers  


Diff between WEB APPLICATION AND CLIENT-SERVER APPLICATION?

2 Answers  


When using descriptive programming?

0 Answers  


Please give me the steps to carry out datadriven in QTP8.2

2 Answers  






wht type of User defined functions or Java Releated functions Do we write in VB scripting

0 Answers  


How can I replace all the text from the QTP script with some other text. Is there any replace all function in QTP Any one can help me

5 Answers   Livetek, Virtusa,


How will you handle java tree in qtp?

0 Answers  


HOW TO DO THE BATCH TESTING USING QTP?

8 Answers   CTS,


How to record right click of a context menu and click on the selection ?

3 Answers  


How to handle "Java Runtime error" popup window in the web application ? Sometimes the application throws the error repeatedly... Is there any browser setting available to disable the error ?

2 Answers   TCS,


Hi any body can tell me the in detaled information about Description.Create() thanks in advance

2 Answers  


Categories