Because I added code to show which line the error occurs on of course.How do you know the error occurs in that line?
Code:Private Sub tmrCheckPreview_Timer() Dim lRetVal As Long Dim lhPrevhWnd As Long Dim iTmp As Integer Static iTimesHere As Integer Static iCurrentIndex As Integer On Error GoTo ErrHandler LogIt "tmrCheckPreview Enter" m_Finished = False 100 If IsWindow(m_PreviewhWnd) And (m_Finished = False) Then 110 iTmp = (iTimesHere \ 10) + 1 120 If iCurrentIndex <> iTmp Then 121 imgTmp.Picture = lblIcon(iTmp).DragIcon 122 picLogo.PaintPicture imgTmp.Picture, 0, 0, picLogo.Width, picLogo.Height 123 End If 124 iCurrentIndex = iTmp 125 iTimesHere = (iTimesHere + 1) 127 If iTimesHere >= 30 Then iTimesHere = 0 Else 130 LogIt "preview unload" 132 tmrCheckPreview.Enabled = False 133 m_Finished = True 134 Unload Me End If LogIt "tmrCheckPreview End" Exit Sub ErrHandler: LogIt "tmrCheckPreview Error:" & Err.Description & " Line " & Erl Resume Next End Sub1/21/2013 1:54:47 PM: tmrCheckPreview Error:Client Site not available Line 122




Reply With Quote