Forum Discussion
Concerning the ACE driver boolean flag (the third parameter in the DDT.ExcelDriver method). If you have Excel 2007 or later installed, that should be set to true. That is to use the ACE driver instead of the ODBC driver when connecting to an Excel book to access sheets as data tables. Honestly, they should both be set to true if you are Excel 2007 or later or both be set to false if using anything earlier than Excel 2007.
As for having the Excel workbook open while you are using the DDT.ExcelDriver method... that's a no-no with the ACE driver (with the ODBC driver, not so much). This is because the ACE driver actually uses (as I understand it) the Excel data connectivity components of the Excel application. So, with the workbook open, you have effectively, in database terms "locked" the table for reading with an exclusive lock.
Generally speaking, when you are running tests using Excel as a data storage, you should NOT have the Excel workbook open while the tests are running. While the ODBC driver allows it, it's still not a good practice... you could be changing data records while the test is in progress. Close your Excel book, set both properties to "true" to use the ACE driver, and re-run your tests.
I'm using Excel 2016 and I changed the third parameter to True. Tm still facing the same problem, Testcomplete waits for a long time without any Execution or it exits after connecting to the first driver !
- tristaanogre8 years agoEsteemed Contributor
rhsou123 wrote:
I'm using Excel 2016 and I changed the third parameter to True. Tm still facing the same problem, Testcomplete waits for a long time without any Execution or it exits after connecting to the first driver !
Did you close the workbook? Basically, set the options to true... and then DON'T have the Excel document open anywhere in your environment.
Also, I don't know if there is a typo in what you posted, but in your call to the second driver, you don't have any quotes around the actual filename. So, if that is actually the way it is in your code, that would be a problem, too.
Additionally, your first driver is pointing to "Sheet1"... your second driver indicates to use a sheet called "BatchRun"... is this the true sheet name for the second driver? Verify you have ALL values set properly within your call to DDT.ExcelDriver...
AND Close the workbook...- rhsou1238 years agoContributor
The file path that the second driver uses is getting from the first driver means it is the value of a Cell in the first driver, and I verified, I'm using the correct path also the sheet name is correct.
After connecting to the first driver, I verify if some conditions are true in it, if yes I connect to the second one.
Does this make the problem ?
PS: my files are closed !
- baxatob8 years agoCommunity Hero
Try to close the first driver before starting the second one.
DDT.CloseDriver(yourDriver)