Question about QueryTables.Add

  • Thread starter Thread starter Kenji
  • Start date Start date
K

Kenji

I use the following code to import a file onto my excel sheet. However,
when I do it twice, excel gives an error on the " .Refresh
BackgroundQuery:=False" and excel pretty much becomes unstable. How can I
fix this problem? Thanks!

------------
With Sheet7.QueryTables.Add(Connection:= _
"URL;" + "http://www.whatever.com/test.txt", _
Destination:=Range("A1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
 
Nevermind, the xml sheet I was getting was a blank.. that was why.

<xml></xml> will cause this error.

Kenji
 
Back
Top