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 many types of recording modes in qtp?

0 Answers  


what is meant by source control?

0 Answers   Ordain Solutions,


Why we have to split actions in a test?

4 Answers  


How can i check all the button that are enabled in a widnows based application ? What script should i write for this ?

1 Answers  


How to Synchronize the Browser at Field level? For example if you put Browser.sync(), it will wait upto for that Browser sync only. But It should wait upto total Browser get uploaded with all fields. Note : We don't know Which fields will come in that Browser. Means without knowing field names.

1 Answers   HP,






How many scripts do you write per day. What is the average number of scripts you have written in your recent project

1 Answers   CenturyLink, Optum, Value Labs,


How does QTP identify an object?

0 Answers  


Among the 4 capture levels, Complete, Partial, Minimal, None. which one is mostly used?

1 Answers  


what is On Error Resume Next ?

1 Answers   Accenture,


what is a active x control?can any one brief me about active x controls

1 Answers  


Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya

0 Answers  


How can we use the "CreateObject ("Scripting.FileSystemObject")" in QTP and what is the definition and purpose of it?

2 Answers  


Categories