Unified Functional Testing Automation

ImportSheet Method


Imports a sheet of a specified file to a specified sheet in the design-time or 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.

For details on importing data sheets to components and Business Process Tests, see the topic on importing and exporting data sheets in the UFT User Guide.


DataTable.ImportSheet FileName, vtSrcSheet, vtDstSheet




The full or relative path of the Excel table from which you want to import a sheet. It can be a file system or ALM path.
The name or index of the sheet in the file that you want to import. Index values begin with 1.
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 design-time or run-time data table.

DataTable.ImportSheet "C:\name.xls" ,1 ,"name"