NullReferenceExeption pour un htmlDocument
bonjour à tous.
voila, je développe une application dans mon entreprise et je doit modifier l'attribut d'une iframe html dans une form vb. Voila la partie de mon code qui s'en charge :
Code:
1 2 3
| Main.navigateur.Navigate(Application.StartupPath & "/" & "webapp.html")
Dim script As HtmlElement = Main.navigateur.Document.GetElementById("fichier")
script.SetAttribute("src", cheminFichier) |
Mais voila, lorsque j'arrive à la dernière ligne, j'ai une NullReferenceExeption car script = Nothing... Pourtant je ne peut pas instancier avec New car pour un htmlDocument il n'y a pas de constructeur.
Quelqu'un a-t-il une solution ?
Merci d'avance