Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Syntax for how to call one script from another? and Syntax to call one "Action" in another?

2 Answers  


In google i'm going to search something like "rose", i usually get 10 results in the first page and in 2nd page 10 results and in 3rd 10 results so on upto 10th page 10 results. so if i want to open all the 10 pages 10 results i.e., 100 results and close..what is the DP for this? pls can anyone answer my Question..PLZZZZZ...

4 Answers   Indium Software,


write the regular expression for date format of mm/dd/yy?

10 Answers   CTS, HCL,


Suppose you are using shared objects repository in your test and you want to split your present action? At that time shared object repository is single or it’s also splits?

0 Answers  


What are accessibility check point and xml check point?

5 Answers   IBM,


Explain in brief about the qtp automation object model (aom).

0 Answers  


I have enrolled for a QTP course which is a four weekend course.Do you think its a good way to start off learning this tool?What all do i need with me in order to become a pro at using this tool?

0 Answers   TCS,


How to supress warnings from the "Test results page"?

6 Answers   BirlaSoft,


Can any body help me to write descriptive program to find a cell value (say 2 row, 3rd column) in a datatable which is creating dynamically and statically

0 Answers  


In a QTP project lets say there are 100+ function library and incorrectly we have duplicate some function in multiple libraries. How to find those duplicate functions and remove them?

1 Answers  


What are the different ways to invoke an application using QTP?

0 Answers  


OPening of notedpad in QTP to write and execute the coding?

2 Answers  


Categories