Excel Error Codes

Fix Excel Get Data Errors When Connecting to SQL Server

Nimra MalikNimra Malik Nov 20, 2026 870 views

Question details

Create a new SQL Server connection in Excel without an unexpected object reference error.

Fix Excel Get Data Errors When Connecting to SQL Server
Product
Microsoft Excel for Microsoft 365
Device & OS
not provided
Scenario
The user is creating a new SQL Server connection through Excel's Get Data menu after upgrading from Office 2013.
Observed behavior
Excel displays an object reference error when creating a new connection, but existing connections and the new query in Safe Mode work.
Before you start

Have the SQL Server name and any required connection credentials available. The Safe Mode and clean boot instructions below apply to Windows.

Solution 1Recommended

Identify the Excel add-in causing the connection error

Use this approach when the SQL Server query works in Excel Safe Mode but fails during a normal launch.

Safe Mode working suggests that an add-in or another startup component may be involved; it does not mean you must keep using Safe Mode.

1
Test Excel in Safe Mode

Close Excel. Press Windows+R, enter excel /safe, and select OK. Try creating the connection through Data > Get Data > From Database > From SQL Server Database.

2
Disable COM add-ins

Close Safe Mode and reopen Excel normally. Go to File > Options > Add-ins, select COM Add-ins in the Manage box, and click Go. Note the enabled add-ins, clear their checkboxes, and click OK.

3
Check Excel add-ins

In File > Options > Add-ins, select Excel Add-ins in the Manage box and click Go. Note and temporarily disable enabled add-ins, then click OK.

4
Test add-ins individually

Restart Excel and retry Data > Get Data > From Database > From SQL Server Database. If it works, re-enable the previously enabled add-ins one at a time from their Manage dialog, restarting Excel and testing the connection after each change.

Identify the Excel add-in causing the connection error
If an add-in causes the error: Leave the identified add-in disabled and check with its publisher for an update or compatibility guidance.
Free Microsoft Office alternative

Work with Excel Spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and compatibility with Microsoft Office formats. Open existing files to make the move between office suites easier; it does not fix Excel's SQL Server connection error.

Open and edit Microsoft Excel XLS and XLSX files.Review and analyze spreadsheet data in a familiar interface.Use a free, lightweight office suite for everyday work.Work with Microsoft Word and PowerPoint formats alongside spreadsheets.
microsoft office alternative - wps office

Frequently Asked Questions

Where do I create a SQL Server connection in Excel?

Go to Data > Get Data > From Database > From SQL Server Database, then enter the server and connection details.

Do I need to keep using Excel in Safe Mode?

No. If the connection works in Safe Mode, use File > Options > Add-ins to test add-ins in a normal Excel session and identify a possible conflict.

Why do existing connections work while a new one fails?

Creating a new connection may trigger a different dialog or startup component than refreshing an existing one. A successful Safe Mode test makes an add-in or startup conflict worth investigating.

What if disabling add-ins does not fix the error?

Check the SQL Server driver or provider with your database administrator. On Windows, a clean boot can also help isolate conflicts from non-Microsoft services or startup applications.