View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default strange 400 error from web query

Check the help for the .Refresh method and its augments. This will help
..Refresh False 'Execute query

NickHK

wrote in message
ups.com...
I'm having a slight problem with a VBA web query. It returns a "400"
error, but then proceeds to fetch the relevant data anyway. Is there
any way to avoid the error message?

Code below:

Public Sub Getdata()
With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://www.berlinale.de/en_1/filmmar.../programmsuche
..php?print_view=result", _
Destination:=Range("A1"))
.Name = "DJIQuery"
.WebSelectionType = xlSpecifiedTables
.WebTables = "1" ' DJI table
.WebFormatting = xlWebFormattingNone
.EnableRefresh = True
.Refresh 'Execute query
.RefreshPeriod = 5 'Unit in minutes
.EnableRefresh = False
End With
End Sub