Skip to main content

I am facing an issue with the Excel Database connection operation with one of the processes where repeatedly getting the error message as “Could not connect to Database. External table is not in the expected format” while trying to connect to the Master file. The same file, being able to open through Excel Advanced Open command at the same time. This issue came across only after combining all Child BOTs into the Main BOT. The issue is not facing when I run that process separately.

Hi @vincet.earnest ,

 

Let's try with the basic things first. Please confirm the below points to give better feedback on this.

 

  • Have you installed the Microsoft Access Database Engine 2010 Redistributable driver? If yes, what is the bit version of it?
  • What is the Connection mode given?
  • What is the Connection string given?
  • Have you mentioned the Session names correctly everywhere?

Hi @Padmakumar ,

 

Thanks for the response. Please find the requested details.

  • I have already installed the Microsoft Access Database Engine 2010 Redistributable 32-bit version.
  • Connection Mode - Default.
  • Connection String :

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\VEarnest\RPA Practice\Audit Expeditures.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES"

  • Yes, session names are correctly mentioned.

Hi @Padmakumar ,

 

Thanks for the response. Please find the requested details.

  • I have already installed the Microsoft Access Database Engine 2010 Redistributable 32-bit version.
  • Connection Mode - Default.
  • Connection String :

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\VEarnest\RPA Practice\Audit Expeditures.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES"

  • Yes, session names are correctly mentioned.

 

Ok. Then, kindly try after changing the Database package version in both Parent and the Child bots.


How can I do that? If you don’t mind, could you please help me with the screenshot?


How can I do that? If you don’t mind, could you please help me with the screenshot?

 

Open the respective BOT and click the 3 dots on the top and select the Packages from the dropdown list.

 

Select the Database package from the next window and choose the Package version from it.

 

Finally, select the Change version option.

 

Hope this will help.


Hi @Padmakumar ,

 

Thank you for the assistance. It is working after changing the package version. 


Hi ​@Padmakumar ,

I am also facing same issue for database connection.
Which version should i use latest one or old ones from below,
 

 


Hi ​@Padmakumar ,

I am also facing same issue for database connection.
Which version should i use latest one or old ones from below,
 

 

 

This issue is not always related to the Action Package version. The error "External table is not in expected format" typically occurs when there is an issue with the format of the Excel file you are trying to access using the OLEDB connection.

If your Excel file contains mixed data types (e.g., text and numbers in the same column), consider adding IMEX=1 to your connection string.

 

Additionally, consider checking the below points if the above one didn’t help at all.

  1. Check File Extension: Ensure that the file extension matches the actual format of the file. If your file is saved as .xlsx, make sure it is indeed in the Excel 2007 or later format. If it is actually in a different format (like .xls), you may need to update your connection string accordingly. 

  2. Update Connection String: If you are working with an .xls file, update your connection string to use the appropriate provider:

    • For Excel 97-2003 files (.xls):
      Provider=Microsoft.OLEDB.4.0;Data Source=$sProcessFilePath$;Extended Properties="Excel 8.0;HDR=YES";
    • For Excel 2007 and later files (.xlsx):
      Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$sProcessFilePath$;Extended Properties="Excel 12.0 Xml;HDR=YES;";
  3. File Integrity: Ensure that the Excel file is not corrupted. You can try opening the file in Excel and saving it again to ensure it's in the correct format.

  4. Check for Hidden Sheets or Data: Sometimes, hidden sheets or unsupported data types can cause this error. Open the file in Excel and check for any unusual formatting or hidden sheets. 

  5. Remove Unused Columns: If you added columns using the set cell action, make sure those columns do not contain incompatible data types or formatting that might confuse the OLEDB provider.


Hi I have crossechecked all things still it is having issue to connect stage.


Hi I have crossechecked all things still it is having issue to connect stage.

 

Please share your connection string


Provider=Microsoft.ACE.OLEDB.12.0;Data Source="$strTrackerFilePath$";Extended Properties="Excel 12.0 Xml;HDR=YES"


Your connection string uses "Excel 12.0 Xml;HDR=YES" — try simplifying it to: 

Extended Properties="Excel 12.0;HDR=YES"

The "Xml" part can cause issues if the file isn’t strictly XML-based Excel.

 

Additionally, check the below points as well.

 

  • Corrupted File
    Use Excel’s Open and Repair feature:
    File > Open > pselect file] > click dropdown next to Open > Open and Repair

  • Permissions or Read-Only Mode
    Ensure the file isn’t marked as read-only or locked by another process.

  • Driver Compatibility
    Confirm that the Microsoft Access Database Engine (ACE OLEDB 12.0) is properly installed. If not, you can download it from Microsoft.

 


Reply