SOLVED
Home

Connecting Excel to SQL Server 2017

%3CLINGO-SUB%20id%3D%22lingo-sub-278700%22%20slang%3D%22en-US%22%3EConnecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-278700%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20recently%20downloaded%20and%20installed%20SQL%20Server%202017%20on%20my%20laptop%20and%20I%20am%20having%20trouble%20connecting%20excel%20with%20said%20server.%20I%20have%20tried%20a%20variety%20of%20trouble%20shooting%20options%20(TCP%2FIP%20enabled%2C%20checking%20that%20browser%20is%20active%2C%20named%20pipes%20is%20enabled%2C%20shared%20memory%20enabled%2C%20making%20sure%20that%20outside%20connections%20are%20allowed%20in%20Microsoft%20Excel%2C%20etc.)%20and%20every%20time%20I%20receive%20one%20of%20the%20following%20messages%3A%20error%2040%20or%20error%2026.%20I%20even%20adjusted%20the%20string%20and%20made%20sure%20my%20instance%20and%20server%20name%20were%20correct%20(NE-SF-T******%5C%5CSQLSERVER%20and%20%22.....%5C%5Cmssqlserver)%20and%20I%20am%20still%20running%20into%20the%20same%20error.%20Any%20help%20on%20this%20would%20be%20appreciated.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-278700%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETraining%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-280996%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-280996%22%20slang%3D%22en-US%22%3ENo%20worries!%20It%20happened%2C%20and%20will%20happen%2C%20to%20everybody%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-280870%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-280870%22%20slang%3D%22en-US%22%3E%3CP%3EWow..I%20feel%20dumb..it%20works%20now..thanks%20for%20your%20help%20hahahahahahahaha.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-280835%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-280835%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20far%20as%26nbsp%3BI%20can%20see%2C%20using%20SQL%20Management%20Studio%20you%20are%20connecting%20to%20a%20server%20name%20that%20has%20one%20R%20letter%20but%20in%20Excel%2C%20you%20have%20two%20R%20letters%20in%20TIR%3CU%3E%3CSTRONG%3ER%3C%2FSTRONG%3E%3C%2FU%3EEL.%3C%2FP%3E%3CP%3EIf%20you%20are%20connecting%20fine%20from%20SQL%20Management%20Studio%2C%20then%20your%20hostname%20only%20contains%20one%20R.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-280807%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-280807%22%20slang%3D%22en-US%22%3E%3CP%3EHey%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20go%20to%20Get%20Data---SQL%20Server---Input%20servername%5Cinstance%20name%20(I%20have%20tried%20all%20formats%20including%20%22%2F%22%20and%20%22%2F%2F.%22%20and%20%22%5C%5C.%22%20and%20%22%5C%22)%20then%20I%20log%20in%20with%20my%20windows%20credentials.%20Would%20creating%20or%20setting%20up%20a%20mixed%20log%20in%20mode%20solve%20that%20issue%3F%20See%20the%20screenshots..%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-280386%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-280386%22%20slang%3D%22en-US%22%3EHi%20Tirrell%2C%3CBR%20%2F%3E%3CBR%20%2F%3ECan%20you%20please%20send%20a%20screenshot%20of%20the%20login%20screen%20from%20your%20SQL%20Management%20Studio%3F%20I%20just%20want%20to%20see%20server%20type%20you're%20connecting%20to%20and%20server%20name.%3CBR%20%2F%3EAfterwards%2C%20please%20detail%20step%20by%20step%20what%20you're%20doing%20in%20Excel%2C%20how%20you%20are%20trying%20to%20connect%20to%20SQL.%20Again%2C%20screenshots%20will%20be%20helpful.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-279823%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-279823%22%20slang%3D%22en-US%22%3E%3CP%3EHey%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%20I%20am%20able%20to%20connect.%20The%20only%20thing%20that%20I%20can%20not%20do%20is%20connect%20my%20excel%20(externally)%20to%20the%20database%20so%20that%20I%20can%20import%20files%20into%20an%20excel%20document.%20See%20the%20attachment.%20I%20have%20already%20enabled%20pipes%20and%20TCP%2FIP%20connections.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-279813%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-279813%22%20slang%3D%22en-US%22%3EAnd%20were%20you%20able%20to%20connect%3F%20Can%20you%20share%20a%20screenshot%20with%20login%20screen%20from%20Management%20Studio%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-279806%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-279806%22%20slang%3D%22en-US%22%3E%3CP%3EHey%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20SQL%20Management%20Studio%202017%20installed%20and%20operating.%20I%20have%20tried%20running%20it%20as%20admin%20and%20as%20a%20regular%20login.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-279170%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-279170%22%20slang%3D%22en-US%22%3EI%20doubt.%3CBR%20%2F%3EDo%20you%20have%20SQL%20Management%20Studio%3F%20If%20not%2C%20install%20it%20and%20try%20to%20connect%20to%20your%20local%20SQL%20server%2Finstance%20from%20there.%3CBR%20%2F%3EAre%20you%20able%20to%20connect%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-279167%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-279167%22%20slang%3D%22en-US%22%3E%3CP%3EHey%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20responding.%20So%20I%20turned%20windows%20firewall%20off%2C%20allowed%20a%20special%20rule%20for%20the%20port%20and%20the%20server%20and%20I%20am%20still%20receiving%20the%20same%20error%20message.%20Would%20it%20happen%20to%20be%20a%20security%20issue%20on%20the%20excel%20side%3F%20I%20allowed%20all%20connections%20under%20excel..%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-278912%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20Excel%20to%20SQL%20Server%202017%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-278912%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Tirrell%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20are%20you%20trying%20to%20connect%3F%20If%20you%20installed%20SQL%20using%20default%20instance%2C%20then%20you%20only%20need%20to%20specify%20your%20hostname%2C%20without%20instance%20name.%20See%20screenshots%20attached%2C%20my%20hostname%20is%20called%20SQL2017%20so%20I'm%20connecting%20to%20it%20with%20no%20issues.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20still%20have%20issues%2C%20either%20disable%20firewall%20or%20open%26nbsp%3B1433%20and%204022%20TCP%20ports.%3C%2FP%3E%3COL%3E%3CLI%3EOpen%20%3CSTRONG%3EWindows%20Firewall%20with%20Advanced%20Security%3C%2FSTRONG%3E%3C%2FLI%3E%3CLI%3ERight%20click%20%3CSTRONG%3EInbound%20Rules%3C%2FSTRONG%3E%20and%20select%20%3CSTRONG%3ENew%20rule%3C%2FSTRONG%3E%3C%2FLI%3E%3CLI%3EIn%20the%20%3CSTRONG%3ENew%20Inbound%20Rule%20Wizard%3C%2FSTRONG%3E%20window%20make%20the%20following%20modifications%3A%3COL%3E%3CLI%3E%3CSTRONG%3ERule%20Type%3C%2FSTRONG%3E%20%E2%80%93%20Port%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EProtocol%20and%20Ports%3C%2FSTRONG%3E%20%E2%80%93%20TCP%2C%20Specific%20local%20ports%3A%201433%2C%204022%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EAction%3C%2FSTRONG%3E%20%E2%80%93%20Allow%20the%20connection%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EProfile%3C%2FSTRONG%3E%20%E2%80%93%20no%20modification%3C%2FLI%3E%3CLI%3E%3CSTRONG%3EName%3C%2FSTRONG%3E%20%E2%80%93%20SQL%20TCP%26nbsp%3Bports%3C%2FLI%3E%3C%2FOL%3E%3C%2FLI%3E%3C%2FOL%3E%3C%2FLINGO-BODY%3E
Highlighted
Tirrell Brown
Occasional Contributor

Hello,

 

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

Hey

 

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?

Hey

 

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?

Hey,

 

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.

Hey,

 

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..

Solution

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 dumb..it works now..thanks for your help hahahahahahahaha.

No worries! It happened, and will happen, to everybody
Related Conversations
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
2 Replies
Early preview of Microsoft Edge group policies
Sean Lyndersay in Discussions on
65 Replies
*Updated 9/3* Syncing in Microsoft Edge Preview Channels
Elliot Kirk in Articles on
202 Replies