Forum Discussion
13 Replies
Sort By
- baxatobCommunity Hero
Hi,
What exactly did you mean saying "doesn't work correctly"? Did you receive any kind of error?
- rhsou123Contributor
I'm defining two DDT drivers, the first one works correctly even if my Excel file is closed and the second one if my file is open it works too but if it is closed, Testcomplete waits for a long time without executing anything as if it is not getting the Data from the Excel sheet.
this is my code:
set xlDriver = DDT.ExcelDriver("C:\Script-Resources\BatchRun\myfile.xls","Sheet1",True) xlDriver.First while not xlDriver.EOF value1= xlDriver.Value("x") value2= UCase(xlDriver.Value("y")) if value1= "Y" then value3 = xlDriver.Value("z") value4= xlDriver.Value("t") If value2= "ENVIRONMENT_SET" Then value5= value2 BuiltIn.ShowMessage( value5) Else If value5="" Then call Basic.myfunction() ExitTest Else set xlDriver1 = DDT.ExcelDriver(C:\Script-Resources\BatchRun\myfile2.xls,"BatchRun",True) xlDriver1.First while not xlDriver1.EOF value6= xlDriver1.Value("xx") if value6= "Y" then value7= xlDriver1.Value("yy") value8= xlDriver1.Value("tt")
- baxatobCommunity Hero
In the second case you are passing third parameter as True. This should use ACE Driver instead of ODBC:
1st case: set xlDriver = DDT.ExcelDriver("C:\Script- Resources\BatchRun\myfile.xls","Sheet1",false) 2nd case: set xlDriver1 = DDT.ExcelDriver(C:\Script- Resources\BatchRun\myfile2.xls,"BatchRun",True)
Why you are doing so? Try to change it to False.
Related Content
- 7 months agoḼari