Unified Functional Testing Automation

ExportSheet Method

Description

Exports a specified sheet of the design-time or run-time data table to the specified sheet in the specified file.

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

Syntax

DataTable.ExportSheet FileName, vtSrcSheet, [DstSheetName]

Argument

Type

Description

FileName
String
The full file system path of the Excel table to which you want to export a sheet.
vtSrcSheet
Variant
The name or index of the design-time or run-time Data pane sheet that you want to export. Index values begin with 1.
DstSheetName
Variant
Optional. The name of the sheet in the file that you want to create or replace with the data from vtSrcSheet.

Example

The following example uses the ExportSheet method to save the first sheet of the design-time or run-time data table to the name.xls file.

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

The following example creates separate output data table sheets for each iteration of the test.
The test retrieves the number of the row being handled in the current iteration, modifies a value in the global data sheet and then exports the global sheet to a new sheet, named according to the row number.

currentRow = DataTable.GetCurrentRow
DataTable("Param1", dtGlobalSheet) = currentRow
exportedSheetName = "Global-" & currentRow
DataTable.ExportSheet "c:\result.xls", "Global", exportedSheetName