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

How software tester can use constants and variables in scripts?

0 Answers  


Hi All, What is an XML Checkpoint in QTP? How can i use it while testing a web application? Kindly explain in detail. Thanks in advance

2 Answers  


CAN WE USE 'BVA' AND 'ECP' IN AUTOMATION?

3 Answers   Polaris,


if mandatory and Assitive propertys are shows same how will u write skript in QTP window

0 Answers   Wipro,


i did B.Tech cse and i secured 76%. instead of siting at home ... i would like to do some course. can u suggest me in this.

1 Answers  






How to add a standard checkpoint in your test ?

1 Answers  


What is a runtime datatable ?

2 Answers   Ordain Solutions,


how to upload an excel sheet to quality center?

1 Answers  


We have an application which generates links( more than thousand) based on the time stamp dynmically.Each link will download an xls file. we are supposed to click a particular link (which link to click will be obtained thru some buisiness logic).Now the issue is QTP is not recogniging the link(say Var1) though its properties showed mandatory fields text=xyz and html tag=A.I used following code to do this. Browser("ABC").Page("123").Link("text:=" &Var1,"html tag:=A").click, can any one suggest why this is not recognised by QTP though syntax is correct?(Is there any sync issue to be considered?Because on clicking the link it will take 5 mins to open that file)

3 Answers  


what is test scheduleling?

0 Answers   IBM,


How many test scripts are prapare in ur project(HeathCare Insurance).

1 Answers   Virtusa,


how do you remove object repository at runtime and load object repository and verify it

2 Answers   Thomson Reuters,


Categories