That’s my code:
Dim num as integer = 0
For Each s As String In ListBox1.Items
num = num + 1
Dim web(num) As WebBrowser
RefreshIESettings(s)
Web(num).Navigate("http://www.google.com") 'There's the error
wait("5000")
MsgBox(Web(num).Document.Title)
Next
And I get this error only if I do this:
Dim webb As WebBrowser
RefreshIESettings(s)
Webb.Navigate("http://www.google.com") 'Here too
wait("5000")
MsgBox(Webb.Document.Title)
How can I solve it?
Here you create an array of null references:
You need to set the value of
web(num)before using it, or it will just be null.Just change your code to include
before you use
web(num).