Link to home
Start Free TrialLog in
Avatar of DColin
DColinFlag for Thailand

asked on

Specified cast is not valid error

Hi Experts,

Can someone tell me why the 'Do Until' line is causing a 'Specified cast is not valid' error?

    Private Sub BackgroundWorker1_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork

        WebBrowser1.Navigate("http://www.yahoo.com")

        Do Until WebBrowser1.ReadyState = WebBrowserReadyState.Complete
            Threading.Thread.Sleep(10)
            Application.DoEvents()
        Loop

    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial