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

How to get data line by line from web element

2 Answers  


How you calling actions in qtp?

0 Answers  


Hi, I am new to QTP testing and was exploring the frameworks used for automation. I wanted help in writing various scripts and files for keyword driven automation like 1. Control File 2. Test Case File 3. Startup Script 4. Driver Script 5. Utility Script . etc It would be great if someone can give help in this context ... Thanks

0 Answers  


How will u integrate oracel with QTP?

2 Answers   Microsoft,


What is the difference between check point and output value.

5 Answers  


what r the main benefits of automation?

2 Answers  


What is the use of virtual objects?

1 Answers  


What are the challenges you faced during you entire life automation ?

0 Answers   Tech Mahindra,


Define Environment Variable in UFT and its uses?

0 Answers  


How can i select multiple items from a WebList bOX USING QTP

3 Answers   DuPont, Syntel,


How to retrive data from a data table which is in 3rd row,4th column and place it in main script..like retrive name,date from data table..write script for this.

11 Answers   Thatavarti Technologies,


What is the ur roles and responsibilities as automation testing engineer?

2 Answers   Atos Origin,


Categories