Guten Abend,
Guten Abend, Im Beitrag Fehlermeldung:Unbehandelte Ausnahme: System.NotSupportedException konnte das Problem nicht gelöst werden.Deshalb habe ich mal einen Bespielcode generiert, mit dem man das Problem nachvollziehen kann. Das Problem: Die Codezeile
Guten Abend, Im Beitrag Fehlermeldung:Unbehandelte Ausnahme: System.NotSupportedException konnte das Problem nicht gelöst werden.Deshalb habe ich mal einen Bespielcode generiert, mit dem man das Problem nachvollziehen kann. Das Problem: Die Codezeile
For Each link In IEApp.Document.Links
funktioniert immer nur beim ersten Aufruf. Wird im späteren Verlauf erneut For Each link In IEApp.Document.Links
aufgerufen kommt es zum Fehler. Fehler :Unbehandelte Ausnahme: System.NotSupportedException {"Ausnahme von HRESULT: 0x800A01B6"}
Ich komme nicht dahinter warum es nicht funktioniert.Quellcode
- Public Module Main
- Public Sub Main()
- Dim IEApp, link As Object
- Dim url As String
- url = ("https://www.vb-paradise.de/")
- IEApp = CreateObject("InternetExplorer.Application")
- IEApp.Visible = True
- IEApp.Navigate(url)
- System.Threading.Thread.Sleep(2000)
- Do While IEApp.Busy Or IEApp.Document.ReadyState <> "complete" : System.Threading.Thread.Sleep(1000) : Loop
- For Each link In IEApp.Document.links
- If link.InnerText = "Statistik" Then Exit For
- Next
- link.Click()
- System.Threading.Thread.Sleep(2000)
- Do While IEApp.Busy Or IEApp.Document.ReadyState <> "complete" : System.Threading.Thread.Sleep(1000) : Loop
- For Each link In IEApp.Document.links '|-
- If link.InnerText = "Dashboard" Then Exit For
- Next '|-
- link.Click()
- End Sub
- End Module