How to Import data from a ".xls" file to Data table

during Runtime.



How to Import data from a ".xls" file to Data table during Runtime...

Answer / sreeprasad

DataTable.Import("path of the file")

DataTable.ImportSheet("filepath","sheetsource","sheetDest")

Sheetsource:index or name of the sheet in the file which u

want to import. index begins vth 1.

SheetDest: index or name of the sheet in the datatable

which u want to replace vth Sheetsource.Index begins vth 1.

ex:

Datatable.importsheet("c:\name.xls",1,"name")

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More QTP Interview Questions

In QTP whether is it possible to call a function from one action to another action?

1 Answers  


Hi All, I want to know how can we schedule QTP scripts. Am using 9.5 version and in our office they want to schedule individual scripts of QTP so that it can run unattended during night time, Please help me how to do that. 2. what is the use of silent test run in qtp can I schedule the scripts in Silent runner, Please explain. 3.I retrieved data from the database using output value -> Database output value. the result of the query for eg is 5 rows, iam able to output the first row by selecting the cols and adding it to output, but am not able to do it for the rest of the rows. please tell me how to do it. Sorry for posting so many qns, am not able to find answ to any of the above in any websites, hoping that someone would really help me with these here, please help me. awaiting for ur immediate revert. Priya

5 Answers  


Explain how qtp identifies objects?

0 Answers  


What kind of errors can b handled in QTP in real time scenario?

1 Answers  


How to handle dynamic objects in quicktest professional?

0 Answers  






What are the things(properties, and other details) will be recorded while recording an object using normal recording?

0 Answers  


I want to open a text file and then search some specified text in it and then replace that text with some other text i found that text in .txt but do not know how to replace that text can any body help me. if possible put the code for qtp

2 Answers  


Give me brief idea about QTP automation object model?

5 Answers   TCS,


How many types of Recordings are there in QTP and what are they?

7 Answers   Dangote, First Indian Corporation,


Hi.. I want to do parametrization for selecting perticular flighr say XYZ by using local table: criteria: 1.If flight is available msgbox "Flight is available" and then select flight from flight table and click to ok button after that as enter username and ticket no and then stop 2. otherwise msgbox " Flight is not available" and stop Please help me out ..and let me know your responses on dipak.bachhav@gmail.com Regard, Dipak

0 Answers  


How i can change shared repository to per test repository in qtp

1 Answers  


How you will rate urself in QTP in the range of 0 to 5

0 Answers   Genpact,


Categories