<!DOCTYPE html> <html> <body> <form method="post" id="Form1"> <input type="text" id="Username"> <input type="text" id="Password"> </form> </body> </html>Then, from the code:
Dim loInternetExplorer As SHDocVw.InternetExplorer = Nothing loInternetExplorer = New SHDocVw.InternetExplorer loInternetExplorer.Visible = True loInternetExplorer.Navigate("TheUrl") apiShowWindow(loInternetExplorer.HWND, SW_MAXIMIZE) Do While (loInternetExplorer.Busy) System.Threading.Thread.Sleep(100) Loop loInternetExplorer.Document.getElementById("Username").Value = "Something" loInternetExplorer.Document.getElementById("Password").Value = "Something" loInternetExplorer.Document.getElementById("Form1").submit() loInternetExplorer = New SHDocVw.InternetExplorer loInternetExplorer.Visible = True loInternetExplorer.Navigate("TheUrl") apiShowWindow(loInternetExplorer.HWND, SW_MAXIMIZE) Do While (loInternetExplorer.Busy) System.Threading.Thread.Sleep(100) Loop loInternetExplorer.Document.getElementById("Username").Value = "Something" loInternetExplorer.Document.getElementById("Password").Value = "Something" loInternetExplorer.Document.getElementById("Form1").submit()As soon as the second automation is processed, immediately on the first loInternetExplorer.Document.getElementById("Username").Value = "Something" line, this crashes.