I think it's to do with when you record a macro involving creating a
new web query, there is no difference in the code whether or not you
uncheck the option box 'Save query Definition' (after the Import
button has been clicked an Import Data dialogue box appears which has
a Properties button which opens anopther dialogue box containing said
check box).
So if you run the recorded macro you end up with a saved query
regardless, as shown by a new defined Name and a refreshable query.
I found that if after
.Refresh BackgroundQuery:=False
I added the line
.Delete
just before the
End With
statement it semed to have the desired effect of having the data but
not having a refreshable query.
However I was ofttimes left with a Defined Name (only a range) in the
workbook which is removable with
ActiveSheet.Names("www.yourqueryname").Delete after the
End With
statement.
Obviously replace "www.yourqueryname" with whatever the query is named
in the line
.Name = "www.yourqueryname"