ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "On Error" problem with a VBA web query (https://www.excelbanter.com/excel-programming/367894-error-problem-vba-web-query.html)

Brian in London

"On Error" problem with a VBA web query
 
I'm on hold waiting for Microsoft's $45 support for this problem.

Does anybody have any opinion as to whether this will turn out to be:
1. an undocumented bug
2. a documented bug
3. my fault syntatically
4. lack of memory on this computer
5. Yahoo Finance's fault
6. other

Regards,
Brian
"Brian in London" wrote:

Why does "On Error" seem to make no difference? Once every few hundred web
queries will fail because of some timeout or webpage not being available but
the "On Error" doesn't seem to help. The error is always on the last line:
".Refresh BackgroundQuery:= False".

Any insight would be appreciated.

Regards,
Brian

code
excerpt........................................... ...............................

On Error GoTo query3error

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/q?s=" & ticker,
Destination:=Range("A1"))
.Name = "q?s=" & ticker
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False ' was True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.webtables = webtables(trials - 1) ' was "16"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = True ' was False
.Refresh BackgroundQuery:=False
End With
--
Brian

--
Brian

Brian in London

"On Error" problem with a VBA web query
 
They said they can't help. Fcuk!!!! Now they're sending me over to
"professional support".

Brian


--
Brian


"Brian in London" wrote:

I'm on hold waiting for Microsoft's $45 support for this problem.

Does anybody have any opinion as to whether this will turn out to be:
1. an undocumented bug
2. a documented bug
3. my fault syntatically
4. lack of memory on this computer
5. Yahoo Finance's fault
6. other

Regards,
Brian
"Brian in London" wrote:

Why does "On Error" seem to make no difference? Once every few hundred web
queries will fail because of some timeout or webpage not being available but
the "On Error" doesn't seem to help. The error is always on the last line:
".Refresh BackgroundQuery:= False".

Any insight would be appreciated.

Regards,
Brian

code
excerpt........................................... ...............................

On Error GoTo query3error

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/q?s=" & ticker,
Destination:=Range("A1"))
.Name = "q?s=" & ticker
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False ' was True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.webtables = webtables(trials - 1) ' was "16"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = True ' was False
.Refresh BackgroundQuery:=False
End With
--
Brian

--
Brian



All times are GMT +1. The time now is 01:23 PM.

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