Overwriting/Overlapping web query problem

D

dule

I have a web query that overlaps another query. When the second we
query is added to the sheet through vba, it is suppose to overwrite th
data of the first query in which it overlaps. It does in fact overwrit
the data fine, however, it doesnt seem to overwrite the quer
defintion. Therefore, strangely, the overlapped data contains the dat
of the second query, but the query definition of the first query (whic
is problematic, since I will need to refresh these queries at certai
times).

The code first inserts some lines, and then runs this bit to add th
new query table: (both query tables run this code)

With QueryTables.Add(Connection:=ConnectURL, Destination:=[B4])
.PostText = postStr
.BackgroundQuery = True
.PreserveFormatting = False
.AdjustColumnWidth = False
.RefreshStyle = xlOverwriteCells
.Name = strYesterday
.WebSelectionType = xlSpecifiedTables
.WebTables = "4"
.Refresh BackgroundQuery:=False
.SaveData = True
End With

So, i was just wondering if i was missing something.

Also, is there a way to refresh only the data, of a truncated query
that remains? For example, if I delete a row from a query, can
refresh the remaining query without having that row reappear on th
refresh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top