Hi guys,

I am using Get External Data-> Import text file as part of my macro.

This seems to be creating a data connection. How can i remove it as part of my routine, or perhaps call a function that removes all named connections.

With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;" & sName, Destination:=Range(Cells(1, GetColumn("test", shPS)), Cells(1, GetColumn("test2", shPS))))
        .Name = "sName"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = xlMacintosh
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
        1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
        .Refresh BackgroundQuery:=False
        .UseListObject = False
    End With
basic code i used to import...but i need the data connection delete!

Your help is much appreciated =)