Thread: VBA Hangs
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Albert Albert is offline
external usenet poster
 
Posts: 203
Default VBA Hangs

Hmmm...
Lets try troubleshooting it ourselves...

Here are some of the possible culprits in my list. Do you use any of these?

Office 2010 Tech Preview (but the problem occurrs in all installed versions
of office)
Firefox (latest)
IE8
Digsby
Dropbox
Evernote
Windows XP
AVG 8.5
CLCL (Clipboard manager)

Everything up to date...

Regards,
Albert

"Bill Martin" wrote:

None... Someone suggested that perhaps the IE cache was over filling and that
emptying it first would help. He provided a link to this VB patch software to
do it, but I haven't tried it yet. Or even know if it will work in VBA.

http://vbnet.mvps.org/index.html?cod...teurlcache.htm

The timer question has met with resounding silence in several places.

Bill
---------------------------------
Albert wrote:
I have the exact same problem... It's driving me nuts!
Have you found the answer?

"Bill Martin" wrote:

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