I use the following code to download Text files containing data into my applications
Sub QueryN(SheetName As String, N)
Application.DisplayAlerts = False
On Error Resume Next
Range(SheetName & "_Clear" & N).Clear
Sheets(SheetName).Select
Range(SheetName & "_Table" & N).QueryTable.Refresh BackgroundQuery:=False
Application.DisplayAlerts = True
End Sub
When this is run it works except that a window pops up asking which file to down load. This is not necessary as the Query already contains the identity of the file to be used.
It is also a problem to the user who will not in general know the name of the file.
Can this window be suppressed? Application.DisplayAlerts does not help.
John
Bookmarks