Can someone tell me why this coding doesn't work properly? It's suppose to navigate to news.com then if the page takes more than 1second to load, it should be Stopped then and navigate to microsoft.com should be done. Is there something wrong with my timer?
Code:Private Sub cmdStart_Click() On Error Resume Next WebBrowser1.Navigate "http://www.news.com" Dim Check As Long Check = timTimer timTimer.Enabled = True timTimer.Interval = 1000 '*one second timTimer.Enabled = True If WebBrowser1.Busy And timTimer - Check > 1000 Then WebBrowser1.Stop WebBrowser1.Navigate "http://www.microsoft.com" End If Do DoEvents Loop Until Not WebBrowser1.Busy End Sub Private Sub timTimer_Timer() If WebBrowser1.Busy = False Then timTimer.Enabled = False Me.Caption = WebBrowser1.LocationName Else Me.Caption = "Working..." End If End Sub




Reply With Quote