I am trying to automate a number of tasks within an Excel spreadsheet, and am importing data from various csv and txt files from a specific folder using QueryTables. Once all of the data is imported, and I have processed what I need from it, I clear the sheet and delete the QueryTable as per the code below.

For Each Conn In ThisWorkbook.Connections
        Conn.Delete
Next Conn

For Each Conn In Sheets("EventLog").QueryTables
        Conn.Delete
Next Conn

Sheets("EventLog").Cells.Clear

The problem I am having is that when I try to rename the folder (in Windows) from which I imported the data into Excel, I get this message

"The action can't be completed because the folder or file in it is open in another program. Close the folder or file and try again"

It seems as though Excel is still "using" the files I imported, even though I have deleted the connections and QueryTable.
I don't want to close and open my spreadsheet every time I want to rename a folder.
Is there anyway to get Excel to release these files completely ?

The code I am using to import the data is here:

With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;" & FilePath _
        , Destination:=Range("$A$1"))
        .Name = "sample"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = True
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With