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

Hi, I am using OutputCheckPoint for 2 webelements Bed:4 and Bath:2 Full,1 partial in my result page and I am storing the value in the data table. I dont need the string Bed:4,I would like to get only the no 4. How can I get it? Even though I highlight only 4,It is seleting the full value "bed 4". Same thing happend for second webelement Bath:2 Full,1 partial I need only the No 2. I used the following to split MyArray = Split(UIBathResult, " ", -1, 1) But it is giving the value My Array(0)=Bath:2full,1Partial I need the only the nos for further comparision.Any help? Thanks Uma

1 Answers   Patni,


If u prepare bug report in Excel sheet . Is it possible to send thrw Test director? how it is?

3 Answers   Wipro,


Qtp has been installed on my pc but recently ON opening it is giving this error PLEASE REPLY IT IS URGENT IT WAS WORKKING FINE QTPRO.EX THE instruction at "0x7.. ...". referenced memory at "0000....The memory could not be read... Awaiting QTP XPERTS REPly URGENT

0 Answers   Cognizant,


HI How to take screenshots of a Webpage and saving it in a external word document using QTP.

4 Answers   3i Infotech, TCS,


How does QTP identifies the object in the application?

1 Answers   Crea,


Hi, Can we open a test in qtp10 which is saved in qtp 9.2?

0 Answers  


What is the advantage of associating a procedure with a test object?

1 Answers  


How to swap two numbers by using parameter passing method byref in a fucntion and return the result to outside of the function?

1 Answers   CTS, IBM, London,


Explain in brief about the QTP Automation Object Model.

1 Answers   Crea,


Call to copy of an action and call to existing action… i know the diff but in real project how to use..? i want live scenario.pls help me..

0 Answers  


Hi Guys...I just started working with QTP now.The frame work they use hear is Write all the functions in function libraries and pass data using data dictionary either from data table or excel .I kind of understood evrthing but one thing I need to know is How do they recognize objects .Do they use object spy and recognize objects or record them ..Does soemone have any idea how they generally do this is such kind of framework

0 Answers  


Explain roles and responsibilites of 2yrs Automation qtp engineer.

3 Answers   Oracle,


Categories