How open an excel sheet in QTP(not a run time )?

Answers were Sorted based on User's Feedback



How open an excel sheet in QTP(not a run time )?..

Answer / king

Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Application.Visible = True
Set ExcelBook = ExcelApp.Workbooks.Add
ExcelBook.Worksheets(1).Cells(1,1).Value="Ankush"
ExcelBook.Worksheets(2).Cells(1,1).Value="Raju"
ExcelBook.SaveAs "C:\test1.xls"
ExcelApp.Quit
Set ExcelApp = Nothing
msgbox "Completed"

Is This Answer Correct ?    7 Yes 4 No

How open an excel sheet in QTP(not a run time )?..

Answer / pramod

Hello,

It asked for "not a run time " means "not in run time"
Why do you write all VB script code to open Excel in run
time.

It is simple. Click View - data table in QTP.
Right click on Data table window. Select File - Import.
Select the Excel file. that is it.

Is This Answer Correct ?    5 Yes 2 No

How open an excel sheet in QTP(not a run time )?..

Answer / bhavani

set excel=createobject("Excel.Application")
set wb=excel.workbooks.open "path of eccelsheet"
set ws=wb.worksheets "sheetname"

Is This Answer Correct ?    0 Yes 0 No

How open an excel sheet in QTP(not a run time )?..

Answer / cxv

Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Application.Visible = True
Set ExcelBook = ExcelApp.Workbooks.Add
ExcelBook.Worksheets(1).Cells(1,1).Value="A"
ExcelBook.Worksheets(2).Cells(1,1).Value="Ra"
ExcelBook.SaveAs "C:\test1.xls"
ExcelApp.Quit
Set ExcelApp = Nothing
msgbox "Completed"

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More QTP Interview Questions

What is the difference between Datadriven and Parameterization?

8 Answers   Ordain Solutions,


i have to pass the testcases into userid anf password of gmail login page using functions you can take your own testcaseslike userdid should take only lowerletters it should not take special charactors and uppercase letters and password should take only numericvalues it should not take alphanumeric and alphabets

2 Answers  


I have one bitmap image in my webpage. The bit map image is moving like 1 place to 2nd place and 2nd place to 3rd place Etc… in my webpage. I wanted to write script for dynamical objects like above example. Could you please send me the answer for above query.

9 Answers   IBM,


How we can merge the object repositories?say if we have two or three object repositories then how e can merge them? is there any option in Qtp to merge the object repositories

5 Answers   BirlaSoft,


Hi All, I'm Akshaya here, could anybody please help me regarding how to import the excel sheet to run time datatable. But Pl. keep it in your knowledge is that excel sheet is opened. Thanks, Akshaya Madali 9823213538

4 Answers  






what are pretesting activities

0 Answers  


what is mean by output parameters? I need full description with example. tell me any one please

1 Answers  


we have one text box and one list box(list box appear in same page or another page) what ever the text enter in text box that must be displyed in list box as first one. for example if we enter 10 in text box that is the 1st item in list box . after that we enter 11 then 11 is the 1st item and 10 is 2nd item. the maximum limit of list box is 10 items. if we enter 11th item the 10th item is deleted and llth one is add as 1st one and 9th one goes to 10th position part2:maore than the answer for this question i want the the reason why testers go for this kind of risk.what is the use of we testers having these kind of attempts.is that not the problem with the developer .pls answer .real time users of tools.in which way these solutions help to test with r without affecting the developed souce code.

3 Answers  


Local Obj Repository and SOR are editable know, y we have to edit those.. i mean in which situation we need to edit those and how to do..? pls help me..

2 Answers  


HOW CAN QTP AND TEST DIRECTOR CONNECTED TO THE DATABASE AND WHAT R THE OPTIONS?

0 Answers  


does test plan is in test strategy or test strategy is in test plan.

6 Answers   Microsoft, TCS,


how we do database testing with qtp using descriptive programming?

22 Answers   Nutrins, Rohit Technologies, Symphony, Syntel, TCS,


Categories