I am trying to pass a webbrowser object to the background worker in order to parse the currently open page and create a report, but I cant seem to get it right.
I need to access the web elements normally accessed like so:
TagList = WebBrowser1.Document.GetElementsByTagName("TR")
I figured I could do:
wrkCollectItems.RunWorkerAsync(WebBrowser1)
In the "dowork" sub it looks like:
ImportWebPageData(e.argument)
with the following code running:
Private Sub ImportWebPageData(byval objWebArg as object)
Dim TagList As HtmlElementCollection
TagList = objWebArg.Document.GetElementsByTagName("TR") 'specified cast is not valid here
End Sub
How do I need to restructure my code in order to pass the object correctly in order to access it? Thanks