Handling “The connection has been disabled” in Excel Trust Center settings.

The error “The connection has been disabled” (or the message bar warning “Security Warning: External Data Connections have been disabled”) appears when Microsoft Excel blocks an external SQL query, OLE DB link, or web feed from executing. Excel includes a built-in security boundary called the Trust Center that automatically disables outside data connections by default to prevent untrusted files from running unauthorized background scripts or downloading malicious content to your computer.

Quick Answer

To resolve “The connection has been disabled,” open Excel and navigate to File > Options > Trust Center > Trust Center Settings. Click External Content, change the setting under Security settings for Data Connections to Prompt user about Data Connections (or Enable all Data Connections on private corporate networks), and click OK.


Why Excel Blocks Data Connections by Default

Excel’s Trust Center treats all external links—including SQL Server databases, Power Queries, Microsoft Access files, and web APIs—as potential security vulnerabilities. When you open a workbook downloaded from the internet, received as an email attachment, or opened from an unverified network share, Windows tags the file with a security flag known as the “Mark of the Web.”

When this flag is detected, Excel initiates one of two security responses:

  1. Yellow Message Bar Block: Excel displays a yellow warning bar below the ribbon stating: “Security Warning: External Data Connections have been disabled.” In this state, existing queries refuse to refresh until you explicitly allow them.
  2. Hard Block (Red Bar / Dialog Box): If corporate Group Policy (GPO) or internal Trust Center rules completely prohibit external connections, Excel shows a red error banner or dialog box stating that the connection has been disabled by your administrator.

To diagnose broader database connection failures once Trust Center permissions are cleared, see Troubleshooting SQL Connection Failures: Fixing ODBC and Provider Errors.


Step-by-Step Fixes

Method 1: Modify External Content Settings in Trust Center

If your local computer settings are not locked by corporate domain policies, you can adjust your Trust Center permissions directly.

  1. Open Excel and click on File > Options.
  2. In the left navigation menu, select Trust Center.
  3. Click the Trust Center Settings… button in the lower right.
  4. In the Trust Center window, select External Content from the left-hand menu.
  5. Under Security settings for Data Connections, review the three options:
    • Disable all Data Connections: Blocks all external database feeds.
    • Prompt user about Data Connections: Displays the yellow notification bar, allowing you to approve refreshes file-by-file (recommended for standard workstations).
    • Enable all Data Connections (not recommended): Automatically executes all database queries when workbooks open without showing security warnings.
  6. Under Security settings for Workbook Links, select Prompt user about automatic update for Workbook Links.
  7. Click OK, then click OK again to exit Excel Options.
  8. Reopen your workbook and test the connection.

If you encounter issues when opening workbooks containing external file links on startup, refer to Handling “External Link” update errors on Startup.

Method 2: Move the File to a Trusted Location

Changing global Trust Center settings can expose your computer to risks if you open spreadsheets from unknown external sources. A safer and more reliable alternative is adding the specific folder where your business reports are stored to Excel’s Trusted Locations list. Files stored in a Trusted Location bypass security blocks automatically.

  1. Go to File > Options > Trust Center > Trust Center Settings….
  2. In the left menu, click Trusted Locations.
  3. Click Add new location… at the bottom of the window.
  4. Click Browse… and select the folder containing your reporting workbooks (e.g., C:\CompanyReports\Finance\).
  5. If you store workbooks in nested subfolders, check the box labeled Subfolders of this location are also trusted.
  6. Click OK, then restart Excel.

Method 3: Remove the “Mark of the Web” from Downloaded Files

If you downloaded the Excel file from an intranet portal, SharePoint site, or email, Windows may have applied a file-level security lock that overrides Excel’s local settings.

  1. Close Excel completely.
  2. Open Windows File Explorer and navigate to the file.
  3. Right-click the .xlsx or .xlsm file and select Properties.
  4. In the General tab, look at the very bottom for a section labeled Security.
  5. Check the box labeled Unblock.
  6. Click Apply, then click OK.
  7. Open the file in Excel; the disabled connection prompt will no longer appear.

Resolving Next-Stage Security Prompts

Once the Trust Center allows the connection to proceed, your workbook may encounter additional security and permission layers: