mikev
14 years agoContributor
Single Driver, Multiple Sheets Open?
How can I get around this, short of having several excel files. I'll try to explain:
I *think* all of this is working OK, until I get to this point:
The error that I'm getting is:
An exception occurred in the "AddCollections" unit at line 30:
Microsoft JScript runtime error
Object doesn't support this property or method
This is the line with the error:
//Set up the test directory and point to the Excel file that contains our data.
var testDir = Project.Path;
var testData = testDir + "\\MyExcelFile.xls;
//Set up the first driver, to the first sheet in our excel file
var myFirstSheet = DDT.ExcelDriver(testData, "sheet1");
//Get the first value (1st row, 1st column) in our first sheet. I want to use this value to open another sheet.
var sheetValue = myFirstSheet.Value("myFirstField");
//Based on the sheetValue, open up another drivervar mySecondSheet= DDT.ExcelDriver(testData, sheetValue);
I *think* all of this is working OK, until I get to this point:
while (!myFirstSheet.EOF()) {
//For each row in first sheet, we need to run several rows in secondSheet
while (!mySecondSheet.EOF) {
.........
.........
mySecondSheet.Next();
}
myFirstSheet.Next();
The error that I'm getting is:
An exception occurred in the "AddCollections" unit at line 30:
Microsoft JScript runtime error
Object doesn't support this property or method
This is the line with the error:
while (!mySecondSheet.EOF)