Connecting Excel to SQL Server 2017

Tirrell Brown
Occasional Contributor



I recently downloaded and installed SQL Server 2017 on my laptop and I am having trouble connecting excel with said server. I have tried a variety of trouble shooting options (TCP/IP enabled, checking that browser is active, named pipes is enabled, shared memory enabled, making sure that outside connections are allowed in Microsoft Excel, etc.) and every time I receive one of the following messages: error 40 or error 26. I even adjusted the string and made sure my instance and server name were correct (NE-SF-T******\\SQLSERVER and ".....\\mssqlserver) and I am still running into the same error. Any help on this would be appreciated. 

11 Replies

Hi Tirrell,


How are you trying to connect? If you installed SQL using default instance, then you only need to specify your hostname, without instance name. See screenshots attached, my hostname is called SQL2017 so I'm connecting to it with no issues.


If you still have issues, either disable firewall or open 1433 and 4022 TCP ports.

  1. Open Windows Firewall with Advanced Security
  2. Right click Inbound Rules and select New rule
  3. In the New Inbound Rule Wizard window make the following modifications:
    1. Rule Type – Port
    2. Protocol and Ports – TCP, Specific local ports: 1433, 4022
    3. Action – Allow the connection
    4. Profile – no modification
    5. Name – SQL TCP ports



Thanks for responding. So I turned windows firewall off, allowed a special rule for the port and the server and I am still receiving the same error message. Would it happen to be a security issue on the excel side? I allowed all connections under excel..

I doubt.
Do you have SQL Management Studio? If not, install it and try to connect to your local SQL server/instance from there.
Are you able to connect?



I have SQL Management Studio 2017 installed and operating. I have tried running it as admin and as a regular login. 

And were you able to connect? Can you share a screenshot with login screen from Management Studio?



Yes I am able to connect. The only thing that I can not do is connect my excel (externally) to the database so that I can import files into an excel document. See the attachment. I have already enabled pipes and TCP/IP connections.

Hi Tirrell,

Can you please send a screenshot of the login screen from your SQL Management Studio? I just want to see server type you're connecting to and server name.
Afterwards, please detail step by step what you're doing in Excel, how you are trying to connect to SQL. Again, screenshots will be helpful.



So I go to Get Data---SQL Server---Input servername\instance name (I have tried all formats including "/" and "//." and "\\." and "\") then I log in with my windows credentials. Would creating or setting up a mixed log in mode solve that issue? See the screenshots..


As far as I can see, using SQL Management Studio you are connecting to a server name that has one R letter but in Excel, you have two R letters in TIRREL.

If you are connecting fine from SQL Management Studio, then your hostname only contains one R.

Wow..I feel works now..thanks for your help hahahahahahahaha.

No worries! It happened, and will happen, to everybody
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
16 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
11 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Early preview of Microsoft Edge group policies
Sean Lyndersay in Discussions on
65 Replies