| || |
Regarding importing Excel sheet
I know this question has been answered many times but i could not figure it out using search.
I have a excel sheet in my hard drive (c:\test.xls).Now i want to import that file into the script using scripting. I tried using datatable.import, but could not do so. Please let me know how to go about it.
thanks in advance
Re: Regarding importing Excel sheet
This is from the help file:
Imports a sheet of a specified file to a specified sheet in the run-time Data Table. The data in the imported sheet replaces the data in the destination sheet (see SheetDest argument).
The column headings in the sheet you import must match the Data Table parameter names in the action for which the sheet is being imported. Otherwise, your test or component may fail.
The sheet you import automatically takes the name of the sheet it replaces.
If you import an excel sheet containing combo box or list cells, conditional formatting, or other special cell formats, the formats are not imported and the cell is displayed in the Data Table with a fixed value.
DataTable.ImportSheet(FileName, SheetSource, SheetDest)
FileName String The full path of the Excel table from which you want to import a sheet.
SheetSource Variant The name or index of the sheet in the file that you want to import. Index values begin with 1.
SheetDest Variant The name or index of the sheet in the Data Table that you want to replace with the SheetSource. Index values begin with 1.
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:\name.xls" ,1 ,"name"