How to Import data from a ".xls" file to Data table during
Runtime.
Answers were Sorted based on User's Feedback
Answer / rajshri
datatable.Import("file path")
datatable.Importsheet("file path",sheetid)
Is This Answer Correct ? | 18 Yes | 0 No |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Could some one help me the difference between GetTOProperty and SetTOProperty and when we will use these properties. and what is meant by SetToProperties..
how to write the descriptive programming in QTP for loginwindow.without using Step generator,object repository for referecnes
What is the difference between run time object and test object in QTP?
Is QTP Supports SWT applications? If yes, can you write a sample script for opening a new package in eclipse.
HI. AnyBody can explain Automation Testing Framework...Generally wht do we Intiate before going to start Automation testing process... Anybody can explain.......Thanks in advacne...
what is the present location of nageshwara rao's institute in hydrabad along with institute phone no. and name of institute.He has shifted from S.R Nagar.
hi is there any chance to change encoding the password
We have opened three browser such as Facebook,Gmail,Amazon,I want to generate the script of Login of Amazon application, but while adding the object such as edit box(user id,password) in OR is not added.Could you please resolve my issue
Is virtual object supported in low level recording mode?
write a qtp script to verify that the business price is twice the economy price in flight reservation window
Write the code for select the 5 values from drop down list. drop down list having the 10 values.
Hi i have a webtable which is having 7 columns and 6 rows of data in that table of 4th and 5 th column each row is partiotioned into 3 sub rows i want to verify in each partitioned rows of corresponding row for ex values will be like this 0 / 1 ,26/28.if it is 0/1 i want to skip only if any num/num greater than 1 i want to click.