Apr 29 2019 11:31 AM
How can you use VBA to reset Data source settings Under Menu Data > Get Data > Data Source Settings where my worksheet has a Data source under the radio button 'Global Permissions' ?
by Clicking the "Clear Permissions" button and selecting "Clear All permissions" this will clear out all power query URL references. But, how can this be done in VBA ?
with VBA I can clear data sources that are 'in current workbook' (using code below) but this will not work with the "Global Permissions".
Sub RemoveConnections()
For i = 1 To ActiveWorkbook.Connections.Count
If ActiveWorkbook.Connections.Count = 0 Then Exit Sub ActiveWorkbook.Connections.Item(i).Delete i = i - 1
Next i
End Sub
Apr 30 2019 12:34 AM
May 17 2019 12:29 PM
I don't know if this will help much, it seems setting for Global Permissions is outside of the workbook and a setting on the computer (example my global permission is my log in to sharepoint site). May require access a .DLL office API since their is no connection directly saved in the workbook.