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: 279
Default Watchdog timer issues

I am using XL 2003.

I have a need to run Internet Explorer for about 20k URLs.
This is beyond the capacity of IE on my system.
I use a 30 second watchdog timer to detect IE becoming unreasonably slow.

Relevant code is:

' Needs Tools/References/Microsoft Internet Controls
Public ie As SHDocVw.InternetExplorer

Private killtime As Date
Private Const killduration As String = "00:00:30"
....
Private Sub kill_ie()
Debug.Print now & " kill_ie() called"
killtime = 0
Set ie = Nothing
End Sub

Public Function Wait4IEretry(ByVal operation As String) As Boolean
....

On Error GoTo newie
....
killtime = now + TimeValue(killduration)
Application.OnTime EarliestTime:=killtime, Procedu="kill_ie", Schedule:=True
Wait4IE operation
Application.OnTime EarliestTime:=killtime, Procedu="kill_ie", Schedule:=False

If False Then
newie:
If killtime < 0 Then
On Error Resume Next ' ontime may not be set
Application.OnTime EarliestTime:=killtime, Procedu="kill_ie", Schedule:=False
End If

Set ie = Nothing
Resume retry
Stop
retry:
' Stop
Wait4IEretry = False
Exit Function
End If
....
Wait4IEretry = True
Exit Function
.....
End Function

So Wait4IEretry starts a 3o second watchdog timer on Wait4IE completing
in 30 seconds.

If 30 seconds elapses, kill_ie is called and ie is made nothing, causing
Wait4IE to complete with an error and transfer control to label newie.
I find "On Error Resume Next" ineffective against errors in Application.OnTime.
I zero killtime in kill_ie so Application.OnTime is not called.
If I hit escape to allow me to save my XL file, Application.OnTime is called and errors.
Why is "On Error Resume Next" ineffective?

If 30 seconds does not elapse, the timer is cancelled without problem.

I can't work out how to make killduration a date.
In the immediate debug window, I see
?#00:00:30#
00:00:30
?timevalue("00:00:30")
00:00:30

In the debug code window,
Private Const killduration As Date = #00:00:30#
is transformed into
Private Const killduration As Date = #12:00:30 AM#

As an sside, many cells in my worksheet have a small triangle marking
their upper left corner. I remember that as meaning there is some
strangeness about the data in the marked cells. I just can't
work out how to Google it.
excel cell warning message is ineffective.
excel cell triangle corner suggests a formula error and that a trace
error button should appear - it does not - the cells contain values.
Unsetting Tools/Options/Error checking/Number stored as text
causes those triangles to vanish and I now know what the issue is.
How to I get "Number stored as text" to appear as a warning?
--
Walter Briscoe
 
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
timer Roger on Excel Excel Programming 2 August 3rd 08 11:37 AM
timer mike allen[_2_] Excel Programming 3 March 16th 07 11:05 PM
Lap-timer kabildgaard Excel Discussion (Misc queries) 0 August 11th 06 03:26 PM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
need help with a timer ionaman Excel Programming 0 April 13th 04 08:40 PM


All times are GMT +1. The time now is 02:53 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"