LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default VBA Hangs

I have VBA code that reaches out to Yahoo to retrieve some information.
Occasionally it will hang indefinitely. I get the status message "Connecting to
the web" so my assumption is that the web has not responded with some hand shake
that Excel was expecting to get. When it hangs there's apparently no way to
shake it alive from the keyboard. I can only exit Excel entirely and restart
everything.

I've tried trapping the hang with an "On Error Goto" statement, but apparently
Excel does not think there's any actual error - it's just waiting for a response.

The actual web fetch is of the form:

With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl,
Destination:=QuerySht.Range("A1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With

Is there some way I could set a timer for 10 seconds, or whatever, before
executing the web fetch and use it to somehow 'Break' execution of the VBA
statement that's hung?

Thanks.

Bill
 
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
sql hangs Richard Douglass Excel Programming 3 June 15th 09 05:44 AM
sql hangs Jim Cone[_2_] Excel Programming 0 June 15th 09 04:48 AM
Excel hangs... coder_arun Excel Programming 2 April 25th 06 01:46 PM
Macro Hangs GregR Excel Programming 0 March 27th 06 10:40 PM
VBA Hangs sponny Excel Programming 2 November 4th 05 02:58 PM


All times are GMT +1. The time now is 06:26 PM.

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

About Us

"It's about Microsoft Excel"