Forum Discussion
mugheessiddiqui
12 years agoContributor
Hi Warren
It's late reply but finding the cause and documenting the solution for the others.
In XLS file if worksheet name has spaces in it, you'll get the exception "Unexpected error from external database driver (22)".
Rename worksheet in xls document by replacing spaces with "_" and run the following code, it will work fine.
It's late reply but finding the cause and documenting the solution for the others.
In XLS file if worksheet name has spaces in it, you'll get the exception "Unexpected error from external database driver (22)".
Rename worksheet in xls document by replacing spaces with "_" and run the following code, it will work fine.
function test2()
{
GetLookupExcelData("script\\tctemp.xls", "Rotating_Equipment_Capacity_Uni"); // working absolutely fine
GetLookupExcelData("script\\tctemp.xls", "Rotating Equipment Capacity Uni"); //Sheet name with space will throw exception "Unexpected error from external database driver (22)".
}
function GetLookupExcelData(varFilePath, varSheetName)
{
var outarray = [];
DDT.ExcelDriver(varFilePath, varSheetName, false);
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;
}
Related Content
- 10 years ago
Recent Discussions
- 21 hours ago
- 21 hours ago
- 5 days ago