Building custom solutions that extend, automate, and integrate Microsoft 365 apps.
Hi @Petruš Dávid
Thank you for reaching out to Microsoft Q&A.
Based on the information you provided, I understand that you are encountering a runtime error when performing SQL-style joins across multiple external files since December 2025, while local queries remain functional.
After researching the issue, I found the following information for your reference. Based on recent Microsoft Office security changes implemented around late 2025, the ability to perform SQL-style joins between multiple external Excel files (such as .xlsx) via ADODB in VBA may be restricted by default to minimize potential vulnerabilities when processing external data. However, joins within the same file are not affected because they do not trigger the external reference check.
Microsoft introduced a security setting back in May 2021 that lets admins disable remote database references in Jet Red and the Access Connectivity Engine (ACE). Your change in behavior around December 2025 is likely related to Office security update rollouts in that period (organizations often push hardening policies during monthly security updates).
You can check your registry to see if Windows has enabled this blocking mode. However, Microsoft clearly warns that enabling AllowQueryRemoteTables (setting it to 1) reduces security and is not recommended unless you fully trust the data source.
You might also consider using Power Query (Get & Transform), as Power Query allows you to JOIN (Merge) data from multiple different files natively.
Note:
- These changes apply on a per-user/per-machine basis. In a corporate environment, administrators can deploy this via Group Policy (look for "Administrative Templates for Office" in the Group Policy Editor).
- If your setup includes CSV folders in various locations, please ensure the connection string includes the full path, and that those folders are added to Trusted Locations (Trust Center > Trusted Locations).
I hope the details provided will assist you effectively. Please let me know if you need any further adjustments.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.