Delete server connections from excel

nikio8

Board Regular
Joined
Oct 20, 2017
Messages
128
Hi all,
recently there seems to be a problem in excel where it constantly crashes.
I am trying to make it as simple as possible with as few features as possible.

The spreadsheet has few "workbook connections" to a local server. When I open data / connections/ they are there, but there does not exit a button to remove them.

Can they be removed? I only need one connection to another excel file, not even sure how this one was created as file is quite simple.

Thanks in advance,
Nick
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi there. Which version of excel are you using? In excel 2007, when you open the list of connections, the second button down on the right hand side is Remove. If the workbook is protected that would be greyed out.
 
Last edited:
Upvote 0
hi jm
excel 365. i'll have another look, I could not see remove button.
from its conception the file is possibly 10 years old, it could have some quirks.
so far I am thinking to try, rebooting, deleting some .odc?? files from my connection folder. reinstalling office.
creating completely new file and slowly copy paste each sheet.
very rarely is there any advice on how to connect to server directly, possibly this is my chance to practice some more.
but as this is work, I cannot waste too much time
 
Upvote 0
Ah. 365 has some difficulties in this area. On another site I found this code that will remove ALL connections. You could use it to remove them all and then just reinstate the one you need. Alternatively, the code could be modified to skip over the one you want to keep.
Code:
Sub Remove()
Dim connection As WorkbookConnection
Dim query As WorkbookQuery
On Error Resume Next
For Each connection In ThisWorkbook.Connections
    connection.Delete
Next
For Each query In ThisWorkbook.Queries
    query.Delete
Next
End Sub
 
Upvote 0
hi, will try. that is quite disappointing.
But i will make a copy of the file and run it tomorrow.
 
Upvote 0
Found it. I knew it was something simple.
Data, power queries and connections. Then go to connections and delete.
However the file got corrupted and was looking for missing vba dll.
I recreated it. was not too bad, forgot to copy one sheet, but it seems to work ok and file is 20x smaller.
 
Upvote 0
Glad you found the answer, well done! And well done for posting the solution.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,181
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top