Help With Error

Alright, so I can't figure out what is wrong with this code for the life of me.

[code] Dim ta As HtmlElementCollection = browser.Document.Body.GetElementsByTagName("textarea")
For i As Integer = 0 To ta.Count - 1
ta(i).SetAttribute("value", "textarea" & i)
Next[/code]

Every time I run my program I receive a NullReferenceException pointing to my dim statement.

Comments

  • trytakng out the "" around textarea in the dim statement so its just
    (textarea)

    thats the first thing i do if i cant notice anything wrong
  • That wont help it.
  • Shouldn't it be just "ta.Count" and not "ta.Count - 1"?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories