Forum Discussion
Office 365 - Delete data connections in one go
- Feb 04, 2018
you can use this vbscript in a Macro button:
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
Hi P.R. Ortiz, yes, that would work.
Is the best workaround you will find. Please mark my reply as best response if it helped. Thanks.
- Jaron RoseggFeb 06, 2018Copper Contributor
The thing is, that does not help with the case where you want to select multiple, but not all, queries and connections...
- Pablo R. OrtizFeb 06, 2018Iron Contributor
In Get Data -> Edit queries you can select several queries for deletion, and the same for connection permissions in Get Data -> Data Source settings
- Jaron RoseggFeb 06, 2018Copper Contributor
So from Data -> Get Data, I get no Edit. Data Source Settings are available and I can select multiple queries (not, e.g. SQL Server connections) but not actually delete them. When I select multiple. I can press delete but that goes to Clear Permissions. I can change permissions or, individually of course, change the Source.
Could you share a screenprint?