Hi Everyone,
I kinda lost here, how to Get each Queries/Connection Name and put it in a cell? Currently I use this to refresh each of the connection, and I want to put each connection name in a cell after it refreshed. can we do that?
I kinda lost here, how to Get each Queries/Connection Name and put it in a cell? Currently I use this to refresh each of the connection, and I want to put each connection name in a cell after it refreshed. can we do that?
VBA Code:
'3. Refresh all query connections
'------------------------------------------------------------------------------------------------
For Each objconnection In ThatWb.Connections
'Get current background-refresh value
bbackground = objconnection.OLEDBConnection.BackgroundQuery
'Temporarily disable background-refresh
objconnection.OLEDBConnection.BackgroundQuery = False
'Refresh this connection
objconnection.Refresh
'I want to put the connection name in a cell for each of the connection here
'Set background-refresh value back to original value
objconnection.OLEDBConnection.BackgroundQuery = bbackground
Next