Importing a Workbook that has multiple sheets
I have an Excel workbook that contains four sheets. I tried the File>Import method to load the workbook as Help stated it would import all sheets. Only two were imported. The Data Table then contained Global which contained the first sheet of the workbook and the second sheet was renamed to the second sheet of the workbook. I've read the forum and saw you can open a sheet during execution, but I'd really prefer having all four load at runtime. Can only the Data Table only contain two sheets if the test case only has one action?
Re: Importing a Workbook that has multiple sheets
No you can use Excel COM objects to load all 4 sheets, the sheets can be referenced by the name you assign here's how
DataTable.ImportSheet "C:\x.xls" ,1 ,"myDataTableName"
parameters are: Workbook name : sheet number : name used to reference it in QTP.
In the script you would reference it as DataTable("mysheetcolumn","myDataTableName")