Forum Discussion
PAULO
6 years agoNew Member
Hello, You have to save the files as excel workbook. When you work with two different files excel sends this error. I had the same problem and changed the type and solved my problem.
Warren_Sealock wrote:
I'm having some difficulty with the DDT.ExcelDriver, and I'm wondering if anyone has run across this before. Essentially my task is to read in some data from app generated Excel files (XLS and XLSX), I can then use that data for some further testing. The problem is that on certain XLS files the DDT.ExcelDriver throws an odd error: "Unexpected error from external database driver (22)".
Here is the (JScript) code that does it, all it's doing is reading data from the left-most column of the Excel sheet:
function GetLookupExcelData(varFilePath, varSheetName)
{
var outarray = [];
DDT.ExcelDriver(varFilePath, varSheetName, true);
while (!DDT.CurrentDriver.EOF())
{
var value = DDT.CurrentDriver.Value(0)
if (value) outarray.push(value);
DDT.CurrentDriver.Next();
}
DDT.CloseDriver(DDT.CurrentDriver.Name);
return outarray;
}
The error happens on the DDT.ExcelDriver(varFilePaqth, varSheetName, true) line. Note: this ONLY happens with XLS files (so far, but not every XLS file), if I have the same data in a XLSX file I don't get an error at all. Also note on the DDT.ExcelDriver calls, I've tried without the "true" parameter when using XLS files, and I still get the same result (i.e., with and without ACE driver support). I'm using TestComplete 9.10.1894.7.
I will try to attach two files (XLS and XLSX), both containing the same data, that demonstrates the issue.
Related Content
- 10 years ago
Recent Discussions
- 21 hours ago
- 21 hours ago
- 5 days ago