Always prevent untrusted Microsoft Query files from opening
This user policy determines whether Excel opens Microsoft Query files from untrusted locations.
since 0.9.8.11
Purpose
Show registry keys (1)
HKCU\software\policies\microsoft\office\16.0\excel\security\external content\enableblockunsecurequeryfiles
This user policy determines whether Excel opens Microsoft Query files from untrusted locations. It covers .iqy, .oqy, .dqy, and .rqy files. These files can define connections to external data sources, import data into a worksheet, and refresh that data later.
The registry value uses the REG_DWORD type. A value of 1 prevents untrusted Microsoft Query files from opening; a value of 0 removes this enforced block. If the policy value is absent, behavior is governed by the corresponding setting in the user's Trust Center.
Notes
Additional effects
When the policy is enabled, users cannot change the corresponding Microsoft Query file setting in the Excel Trust Center.
The policy applies specifically to the affected Microsoft Query files in untrusted locations. It does not disable every external data connection or every other type of external content in Excel.
Security
Blocking these files prevents an untrusted query file from initiating the external data connection it defines. This reduces the risk that a manipulated file could use the user's available permissions and credentials to access an external data source or make changes permitted by that source.
The policy does not grant or revoke permissions on the underlying data sources. It controls only whether Excel processes the affected query files from untrusted locations.
Possible side effects
Legitimate .iqy, .oqy, .dqy, and .rqy files in locations that Excel considers untrusted cannot be opened. Workflows that depend on these files to import or refresh external data consequently cannot operate while the block applies.
Notes
According to the administrative template description, this policy setting applies only to subscription versions of Office, such as Microsoft 365 Apps for enterprise. The equivalent Trust Center feature may appear in a broader range of Excel versions listed by Microsoft.
Microsoft documentation
Microsoft Support: Block or unblock external content in Office documents