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 Test the mainframe application?(tell me few basic things)

1 Answers   Covansys, IBM, UST,


can we enable smart identification for test object

3 Answers  


What is log file? what is the use of Log fine. How to create? what are the contents and the main advantages of log files. plz do help me in this concepts as i have an interivew on qtp in a couple of days. plz do help me.. thanks in Advance.

1 Answers  


how do u get lib files into scripting files?

4 Answers  


what is the command (keyboard command) to swith from expert view to key word view

3 Answers  






I want to assign values in a table in my software, in first column i will give values, table is of 4x4 i.e 4 row and 4 columns, i m using VBScript in my automation work. it is a simple table for giving values.

4 Answers   TCS, Wipro,


I have faced one issues while doing test in QTP. I have described the scenario below. 1. I have to test web application.In that i want to give input of drop down values in the application. 2. Suppose Drop down has 5 value "A,B,C,D,E".I would like to give value from data table of QTP. 3. I have changed the drop down value as variable in Keyword view and given values in data table "A,B,C,D,E" as one below one. 4. While i am running the script it could not identify the drop down value which is in Data Table.It shows message. How to make value identify by QTP?

1 Answers  


what is the use of VIRTUAL OBJECTS? explain ?

10 Answers   ABC Infotech, IBM, TCS,


Hi, actually I completed Btech(CS). But i Will go to admin (Facility) interview. So, If Interviewer asking like " Why You choose this field". What we say? pLZ PLZ PLZ PLZ >............................................Send me.....

2 Answers  


In QTP , Test Director combination . what is the role of Test Director? How QTP Launching QTP in T.D ? If it is Winrunner possible. but QTP How it is possible?

1 Answers   IBM, TCS,


hi, can u tell me the QTP TEsting process in present real time companies?(beware of this... now a days Recording is not using,, only DP) and don't tell note book answers like step 1 spep2....like this .......post answer with professional skills in simple english words) thank u

0 Answers  


To count the no of links present in the yahoo home page i have written the script like this Set fileSysObject=createobject("Scripting.FileSystemObject") Set linksFileName=fileSysObject.opentextfile ("D:\samplelinkfile.txt",2,true) Set linkDescObj=description.Create linkDescObj("micclass").value="Link" Set noOfLinks=browser("yahoo").Page("Yahoo! India").ChildObjects(linkDescObj) For i=0 to noOfLinks.count-1 linkName=noOfLinks(i).getROProperty("name") linksFileName.writeline(linkName) Next linksFileName.close Set fileSysObject=nothing While running the script it showing error that object "yahoo"isnot found in the object repository. Is there any setting before running the script? if yes what is the steps for it.Im using QTP9.0

2 Answers  


Categories