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

1.How to record ,capture and also script to capture the close buttons. 2.How to record ,capture and also script to capture the options ---File ->save and File ->close in a browser and PDF files. 3.How to compare the Excel sheet values in a report using QTP scripting. 4.How to compare 2 PDf reports using QTP scripts as well reording. 5.How to compare 2 Excel reports using QTP scripts as well reording. 6.How to save a PDF report to a folder and then translate the report to an Excel type of report and compare that Excel Report with an other excel report. Please clarify me

0 Answers  


QTP -object reposistory spy tool is not able to spy the pop up message appearing in the application, so how is that i can handle such run time pop ups in QTP by code???

2 Answers   CGI,


what is the object properties settings in the QTP

5 Answers   DigiTech,


how to write the descriptive programming in QTP for loginwindow.without using Step generator,object repository for referecnes

4 Answers   STC,


Hi, I Would Like to Know which is the Best QTP Certification Training Institute in Hyd? Thanks in Advance kishan

1 Answers  


Is manual Testing replacement of automation testing?Which types of testing we can not do in automation testing but can do in manual testing?

1 Answers   Hewitt, Wipro,


what are pretesting activities

0 Answers  


What is the extention of Virtualobject

1 Answers   Accenture,


Explain the views in the QTP GUI?

0 Answers  


What is accessibility check point?

0 Answers  


What is the regular expression for Yahoo mail Inbox?

2 Answers  


How does you test a weblink which is changing dynamically?

0 Answers  


Categories