For some reason, the error handler below does NOT catch the error. This bit of code sometimes gets a error 91. I have this same type of error handler (minus the elseif err.number = 424) elsewhere in my code and it works fine. The error label is not mispelled. I've verified the code does not even reach the ErrCoke4: label.
On Error GoTo ErrCoke4
Do Until InStr(1, IE.Document.body.innertext, "Update Records") <> 0
txtImageCode.Text = "Looping until 'Update Records' <> 0"
If KoKoMo& < Timer Then
Exit Do 'If the loop runs for 30 seconds, then exit the loop.
If Err.Number = 91 Then
txtImageCode.Text = "Err 91 - Verifying 'Update Records' page failed"
ElseIf Err.Number = 424 Then
txtImageCode.Text = "Err 424 - Verifying 'Update Records' page failed"
Err.Raise (Err.Number & ", " & Err.Description)