I am using the import data query to bring in 4 .wk1 files which are
constantly being replaced (with same file names) by another program.
The problem is that the query locks the source file preventing
replacement so I must eliminate the query after import and before
the files can be updated again.
I found this on another message board and it works great:
Sub Removequeries()
Dim ws As Worksheet
Dim qt As QueryTable
For Each ws In ThisWorkbook.Worksheets
For Each qt In ws.QueryTables
qt.Delete
Next qt
Next ws
End Sub