Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #109489

Watchdog timer issues

From Walter Briscoe <wbriscoe@nospam.demon.co.uk>
Newsgroups microsoft.public.excel.programming
Subject Watchdog timer issues
Date 2016-10-29 14:59 +0100
Organization A noiseless patient Spider
Message-ID <v59JEhDatKFYFw1d@freenetname.co.uk> (permalink)

Show all headers | View raw


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, Procedure:="kill_ie", Schedule:=True
    Wait4IE operation
    Application.OnTime EarliestTime:=killtime, Procedure:="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, Procedure:="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

Back to microsoft.public.excel.programming | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Watchdog timer issues Walter Briscoe <wbriscoe@nospam.demon.co.uk> - 2016-10-29 14:59 +0100
  Re: Watchdog timer issues GS <gs@v.invalid> - 2016-10-29 17:50 -0400
    Re: Watchdog timer issues Walter Briscoe <wbriscoe@nospam.demon.co.uk> - 2016-10-30 20:34 +0000
  Re: Watchdog timer issues GS <gs@v.invalid> - 2016-10-29 17:52 -0400
    Re: Watchdog timer issues Walter Briscoe <wbriscoe@nospam.demon.co.uk> - 2016-10-30 20:38 +0000
      Re: Watchdog timer issues GS <gs@v.invalid> - 2016-10-30 17:14 -0400
        Re: Watchdog timer issues GS <gs@v.invalid> - 2016-10-30 17:36 -0400
          Re: Watchdog timer issues Walter Briscoe <wbriscoe@nospam.demon.co.uk> - 2016-11-02 09:43 +0000
            Re: Watchdog timer issues GS <gs@v.invalid> - 2016-11-02 13:30 -0400
              Re: Watchdog timer issues Adrian Caspersz <email@here.invalid> - 2016-11-03 17:44 +0000
                Re: Watchdog timer issues GS <gs@v.invalid> - 2016-11-03 15:33 -0400
                Re: Watchdog timer issues Adrian Caspersz <email@here.invalid> - 2016-11-03 20:11 +0000
                Re: Watchdog timer issues GS <gs@v.invalid> - 2016-11-03 16:47 -0400
                Re: Watchdog timer issues Walter Briscoe <wbriscoe@nospam.demon.co.uk> - 2016-11-06 10:37 +0000
              Re: Watchdog timer issues Walter Briscoe <wbriscoe@nospam.demon.co.uk> - 2016-11-06 11:42 +0000
                Re: Watchdog timer issues GS <gs@v.invalid> - 2016-11-07 12:18 -0500
  Re: Watchdog timer issues Tqlebvng514 <Thlebkng152@gmail.com> - 2016-10-30 06:03 +0000
  Re: Watchdog timer issues Tqlebvng514 <Thlebkng152@gmail.com> - 2016-10-30 07:03 +0000
  Re: Watchdog timer issues Tqlebvng514 <Thlebkng152@gmail.com> - 2016-10-30 08:03 +0000
  Re: Watchdog timer issues Tqlebvng514 <Thlebkng152@gmail.com> - 2016-10-30 11:04 +0000
  Re: Watchdog timer issues Tqlebvng514 <Thlebkng152@gmail.com> - 2016-10-30 13:04 +0000
  Re: Watchdog timer issues Tqlebvng514 <Thlebkng152@gmail.com> - 2016-10-30 14:03 +0000
  Re: Watchdog timer issues Tqlebvng514 <Thlebkng152@gmail.com> - 2016-10-30 15:03 +0000
  Re: Watchdog timer issues Tqlebvng514 <Thlebkng152@gmail.com> - 2016-10-30 16:03 +0000
  Re: Watchdog timer issues giaxeoto4banh <giaxeoto4banh@gmail.com> - 2016-11-03 12:19 +0000
  Re: Watchdog timer issues tinhdauhcm1 <tinhdauhcm1@gmail.com> - 2016-11-03 16:01 +0000
  Re: Watchdog timer issues dailycuacuonhcm <dailycuacuonhcm@gmail.com> - 2016-11-04 01:52 +0000

csiph-web