Using DB Table Variables to Retrieve Data From Excel Files

Applies to TestComplete 14.90, last modified on June 15, 2021

To access data stored in Microsoft Office Excel files in your tests, you can use DB Table variables. These variables store links to Excel files and provide serial access to data rows stored in these files.

The DB Table variables provide read-only access to Excel data. You cannot use them to change values stored in data storages. To change Excel data during tests, you can use the Excel.Application COM object. For more information, see Working With Excel Files via COM.


To access data in Excel files, you must have Microsoft Office 12.0 Access Database Engine OLE DB Provider installed on your computer. Make sure the “bitness” of this data provider (32- or 64-bit) is the same the TestComplete “bitness”, otherwise, you will get the “The needed data source driver is not installed...” error message. To learn more, see Microsoft Office Excel Data Connectivity.

Working with DB Table variables

You can create these variables on the Variables page of the project, project suite or keyword test editor or when adding specific test operations to a test. When creating a DB Table variable, you specify an Excel file and its worksheet, the data of which the variable will retrieve.

You can use DB Table variables both in scripts and in keyword tests.

Typically, in keyword tests, you use the Data-Driven Loop operation to iterate through Excel file rows. To learn how to use the Data-Driven Loop operation in your tests, see Creating Data-Driven Loops and Data-Driven Testing With Keyword Tests - Tutorial.

See Also

Working with Microsoft Excel Files
Using the DDTDriver Object to Retrieve Data From Excel Files
Working With Excel Files via COM

Highlight search results