Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Background Query Timeout

I am posting this because I just searched the archives and found dozens of
unanswered questions about how to control the web query timeout. I finally
got lucky with VBA Help -- which is very frustrating to use. It seems there
are two parameters:

..RefreshPeriod and .ResetTimer

The useful one is the 1st. There is also mention of QueryTimeout and
Connection Timeout elsewhere in VBA help, but they give errors inside a web
query.

Here's my working code that seems to timeout after 10 seconds and continues
on instead of freezing up when your website does not respond (hard to test
since I can't force a website to not respond!). You'll have to invent your
own method of deciding whether or not the query was successful. I test some
cell I know should have data. If it doesn't, I assume it timed out and I try
again or you can abort with an error message.

With ActiveWorkbook.Worksheets("Temp").QueryTables.Add( _
Connection:="URL;" & strurl,Destination:=Worksheets("Temp").Cells(1, 1))
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.SaveData = True
.RefreshPeriod = 10 'Gives up after 10 seconds of no response
.BackgroundQuery = False 'WAIT for results
.Refresh
End With

I did see Query Events to give a True/False condition upon successful query,
but they require some serious setup that is beyond me, especially since I'm
using a temporary sheet created on the fly just to get the web data and then
it gets deleted.

Good Luck,

Terry

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Background Query Timeout

Please disregard the advice below. It is wrong.

RefreshPeriod is for automatic refreshes of a query and the time value is in
minutes, not seconds.

Still on a quest to find out how to set a time-out for a web query!

Terry

On 6/15/04 4:50 PM, in article , "Terry"
wrote:

I am posting this because I just searched the archives and found dozens of
unanswered questions about how to control the web query timeout. I finally
got lucky with VBA Help -- which is very frustrating to use. It seems there
are two parameters:

.RefreshPeriod and .ResetTimer

The useful one is the 1st. There is also mention of QueryTimeout and
Connection Timeout elsewhere in VBA help, but they give errors inside a web
query.

Here's my working code that seems to timeout after 10 seconds and continues
on instead of freezing up when your website does not respond (hard to test
since I can't force a website to not respond!). You'll have to invent your
own method of deciding whether or not the query was successful. I test some
cell I know should have data. If it doesn't, I assume it timed out and I try
again or you can abort with an error message.

With ActiveWorkbook.Worksheets("Temp").QueryTables.Add( _
Connection:="URL;" & strurl,Destination:=Worksheets("Temp").Cells(1, 1))
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.SaveData = True
.RefreshPeriod = 10 'Gives up after 10 seconds of no response
.BackgroundQuery = False 'WAIT for results
.Refresh
End With

I did see Query Events to give a True/False condition upon successful query,
but they require some serious setup that is beyond me, especially since I'm
using a temporary sheet created on the fly just to get the web data and then
it gets deleted.

Good Luck,

Terry


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Background Query Timeout

Terry wrote ...

Still on a quest to find out how to set a time-out for a web query!


Perhaps this the same issue as the one Robin Hammond posted on recently:

http://groups.google.com/groups?thre...tvigato r.com

Jamie.

--
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TImeIn-TimeOut-TimeIn-TimeOut-HoursWorked ChefBoiRD Excel Worksheet Functions 3 September 20th 05 10:01 AM
Problem with .Background Query option of ODBC Query Shilps Excel Programming 0 April 19th 04 06:41 AM
Web Access Timeout Nigel[_6_] Excel Programming 3 February 28th 04 07:52 PM
Timein-Timeout Jim Stewart Excel Programming 2 September 1st 03 09:49 AM
Web query timeout Karyn Mak Excel Programming 0 July 16th 03 11:48 AM


All times are GMT +1. The time now is 12:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"