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 an Custom Object in QTP ?

1 Answers  


Plz explain about object propeties in object identification? means.. explain about 1. mandatory properties.2. assestive properties 3. ordinal properties.

3 Answers   TCS,


How to Start recording using QTP?

1 Answers  


what is the main process in QTP?

3 Answers   Ordain Solutions,


Explain the concept of how QTP identifies object.

5 Answers   Ordain Solutions,






On what basis we select test cases to automate?

0 Answers  


what type of run time errors you get while you ar edoing rpg program?

0 Answers  


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

0 Answers   Tech Mahindra,


1>why parameterization is necessary in qtp? 2>if we give constant value then what problem?

5 Answers   Wipro,


How do you perform Regreession Testing?

0 Answers   Nokia,


Where we write the FUNCTIONS, in Expert view (or) in any textfiles like Notepad and save it in Library functions folder? How to cal that functions to our script? How to save that functions to Function generator?

3 Answers  


i have to login into gmail loginpage i have to pass testcase into userid and password by using functions. the test case of user id is it should take only lowerletters alphabetin between 4 to 6 length.it should not take spectial letters.it should not take numbers.testcase for password is it should take numbers and it should not take alphabets note the following things must happen 1 when i give correct password and userid that password and userid should be seen in QTP result and notepad,xl sheet 2 when i gave in valid password the system willgive message please give valid password that particular messaage should be seen in QTP result,norepa and xl sheet

0 Answers   IBM,


Categories