title: Query Tables (QueryTables) in Excel 2010 with VBA with VBA creating many connections
body: <p>I'm following code I found on another site. Here's the basics of my code:</p>
  
  <pre><code>Dim SQL As String
  Dim connString As String
  
  connString = "ODBC;DSN=DB01;UID=;PWD=;Database=MyDatabase"
  SQL = "Select * from SomeTable"
  
  With Worksheets("Received").QueryTables.Add(Connection:=connString, Destination:=Worksheets("Received").Range("A5"), SQL:=SQL)
  .Refresh
  
  End With
  
  End Sub
  </code></pre>
  
  <p>The problem with doing this is every single time they hit the button assigned to this it creates a new connection and doesn't ever seem to drop it. I open the spreadsheet after testing and there are many versions of the connection listed under Connections. 
  Connection
  Connection1
  Connection2</p>
  
  <p>I can't seem to find a way to close or delete the connections either. If I add ".delete" after ".Refresh" I get a 1004 error. This operation cannot be done because the data is refreshing in the background. </p>
  
  <p>Any ideas how to close or delete the connection? </p>