I am loading a web page into a WebBrowser control so that I can access it's HTML later in the code using WebBrowser1.DocumentText. My problem is that I can access the HTML from outside the BackgroundWorker1 thread but I can not access the HTML from within the thread. Instead I get the following error: "Specified cast is not valid" refering to the WebBrowser1.DocumentText line of code. I have checked that it is not a document loaded issue the document has loaded.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

WebBrowser1.Navigate("http://www.google.com/")
BackgroundWorker1.RunWorkerAsync()

End Sub