ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   strange 400 error from web query (https://www.excelbanter.com/excel-programming/382308-strange-400-error-web-query.html)

[email protected]

strange 400 error from web query
 
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...ning_schedule/
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


NickHK

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





All times are GMT +1. The time now is 02:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com