Fix Excel Get Data Errors When Connecting to SQL Server
Question details
Create a new SQL Server connection in Excel without an unexpected object reference error.

- 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.
Have the SQL Server name and any required connection credentials available. The Safe Mode and clean boot instructions below apply to Windows.
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.
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.
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.
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.
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.

Check the SQL Server driver and Windows startup services
Use these checks if disabling add-ins does not resolve the error.
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.

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.




