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

Answers were Sorted based on User's Feedback



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

Answer / rajshri

datatable.Import("file path")
datatable.Importsheet("file path",sheetid)

Is This Answer Correct ?    18 Yes 0 No

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

Answer / deeps

Hi,
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 ?    14 Yes 3 No

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

Answer / chinna

Hi,

Datatable.Importsheet("Path of the sheet",Source sheetid,
Destination sheetid)

Ex.Datatable.importsheet("C:\Book1.xls",1,1)
z=datatable.getrowcount
For i = 1 to z

datatable.setcurrentrow(i)

A=datatable.value(1,1)
b=datatable.value(2,1)
c=a+b
datatable(3,1)=c
Next
msgbox c

Is This Answer Correct ?    10 Yes 1 No

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

Answer / masack

If you want import all the sheets of the workbook during
runtime datatable.

Dim array_shtname()

Set xls = createobject("Excel.Application")
xls.visible = true
Set xlsop = xls.workbooks.open ("excel\path")
shtcount = xlsop.worksheets.count

ReDim preserve array_shtname(shtcount)

For sh = 1 to shtcount
array_shtname(sh-1) = xlsop.worksheets(sh).name
Next
xls.quit

Data_Sheet_Count = datatable.GetSheetCount

For i = 1 to shtcount
Datatable.AddSheet Cstr(array_shtname(i -1))
datatable.ImportSheet "excel\path",i,cint(Data_Sheet_Count)
+i
Next

Is This Answer Correct ?    2 Yes 1 No

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

Answer / sanhosh

The following example uses the ImportSheet method to import the first sheet of the name.xls table to the name sheet in the test's run-time Data Table. 
DataTable.ImportSheet "C:
ame.xls" ,1 ,"name"




How ever in runtime data table iam unable to get the sheet pls help me.

Is This Answer Correct ?    0 Yes 0 No

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

Answer / varun bisaria

Datatable.Import "...XLS file name..."

DataTable.ImportSheet(FileName, SheetSource, SheetDest)
DataTable.ImportSheet "C:
ame.xls" ,1 ,"name"

Is This Answer Correct ?    0 Yes 0 No

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

Answer / giri

datatable.Import("file path")

Is This Answer Correct ?    2 Yes 3 No

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

Answer / srinivasulu

Dim Shet1' Add a new sheet
Data table.Addsheet "shet1"
'datatable.importsheet "file name","Source
sheet","destination sheet"
datatable.importsheet "file name","sheet 1","shet1"
'now we can check the run time data table

Is This Answer Correct ?    0 Yes 1 No

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

Answer / kirankumar.y

varaiable=data table.value("perameter name",dt global
sheet/dt local sheet)
if it is wrong please correct me

Is This Answer Correct ?    1 Yes 4 No

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

Answer / sateesh

i think it is ddt_import("....");

Is This Answer Correct ?    1 Yes 17 No

Post New Answer

More QTP Interview Questions

Hi guys, Please suggest some thing these points are correct???, Is UFT 12 and QTP outdated ??? and also VBscript is also deleted/Removed from QTP ???? Javascript is added latest and tool name is called JFT ??? From this year ??

2 Answers  


i have string "I LIKE INDIA"..how to i get LIKE from the sting..

6 Answers   HealthAsyst,


wt is the xtension of the QTP result view file?

4 Answers  


what is the use of automation frame work ??(QTP)

2 Answers  


does test plan is in test strategy or test strategy is in test plan

2 Answers   Tanla Solutions,


can we change the name of a check point? when will you start writing testcases? do you follow any methodology for writing test scripts? qtp is key word driven testing or data driven testing?

2 Answers  


How to handle Run-time errors?

1 Answers   Crea,


hi friends can any one provide me the project in qtp because i have to attend to interview within one week atleast you provide the website address which provide the qtp projects

2 Answers  


Hoe can we do retesting using functions please give the code for it using login page

0 Answers  


What is an Custom Object in QTP ?

1 Answers  


Explain actions in qtp ?

0 Answers  


Hi All, I need code for how to execute qtp scripts from excell sheet

0 Answers  


Categories