Share via


Operation is not supported error in Access and Excel

Summary

This article discusses the cause of errors that you encounter when you take any of the following actions:

  • Use a query in a Microsoft Access database

  • Use an Open Database Connectivity (ODBC) connection that includes a remote table reference

  • Use wizards to perform tasks in Access

The article provides multiple solutions to resolve the errors.

Symptoms

When you work with Access or Microsoft Excel, you receive one of the following error messages in different scenarios:

Error message: Operation is not supported for this type of object

When:

  • The Access database contains a query that includes a remote reference.

  • You create or refresh an ODBC connection by using either an Access driver or an Excel driver within an Excel workbook.

Error message: Invalid use of Null

When:

  • You add a control or a command button to an Access form or report.

Cause

In 2021, the AllowQueryRemoteTables registry key was added to allow you to disable remote table references when you run a query. This feature helps to make your applications more secure.

Beginning in the Office updates that were released on December 9, 2025, the AllowQueryRemoteTables registry key provides the following values.

Key value Definition
0 Allow only in trusted databases
1 Allow in all databases
2 Disallow in all databases

The "Allow only in trusted databases" is the default value for this registry key.

Check for a remote table reference

To identify a remote table reference, check the SQL syntax of a query or command text, as shown in the following example.

Local table SELECT * FROM `Orders Query`
Remote table SELECT * FROM `C:\temp\Database1.accdb`.`Orders Query`

Solutions

This issue has multiple solutions. Select the solution that’s appropriate for your scenario.

Solutions when you work with Access

  • Add a trusted folder location that includes the database location by using either the Trust Center in Access or via group policy.

  • Disable Control wizards that you use for tasks such as adding a command button.

    Expand the Controls group, and clear the Use Control Wizards checkbox.

Screenshot of the Controls group in Access.

Solutions when you work with apps other than Access

  • Legacy ODBC connections in Excel are commonly constructed to include a remote table reference within the command text. The remote reference is used even if the table or query object that's referenced is local to the database or workbook that’s specified in the connection string. In this scenario, remove the remote table reference from the command text in the query because it's unnecessary. See the following example.
Original Command Text Updated Command Text
Screenshot of incorrect remote reference to local table. Screenshot of correct reference to local table.
  • To update the remote table reference in the command text if the name of the file or table contains spaces, use the following syntax.
Original command text Updated command text
SELECT * FROM `C:\temp\Database1.accdb`.`Orders Query` `Orders Query` SELECT * FROM `Orders Query`

Note

  • These solutions also apply to the Power BI desktop app and other apps that use ODBC connections.
  • Beginning in version 2601 of Microsoft 365 Apps, a remote table reference is treated as a local table reference during query execution if the database or workbook that’s supplied in the connection string matches the file that’s used in the remote table reference within the command text. Therefore, this error won’t occur.

Solution that applies to all apps

Note

Use this solution only as a temporary fix while you update your application.

Set the value of the AllowQueryRemoteTables registry key to 1 to allow remote table references in all databases.

If you configure the AllowQueryRemoteTables registry key by using any of the registry paths for the Click-to-Run (C2R) installation type that are provided in KB 5002984, the registry key might be removed after installing an Office update.

To ensure that the registry key configuration is preserved after an Office update is installed, make sure to add the following DWORD name and value to the registry paths listed in the table:

DWORD name: AllowQueryRemoteTables

Value data: 1

Office Version OS Bitness Office Bitness Registry Path
All supported versions x64 x64 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\16.0\Access Connectivity Engine\Engines
All supported versions x86 x86 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\16.0\Access Connectivity Engine\Engines
All supported versions x64 x86 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\Access Connectivity Engine\Engines