title: Vba Web Navigation and authentication
body: <pre><code>Sub HTML_Element_Printer()
  
  On Error GoTo Err_Clear
  sURL = "https://ernie.erau.edu/"
  Set oBrowser = New InternetExplorer
  oBrowser.Silent = True
  oBrowser.timeout = 60
  oBrowser.navigate sURL
  oBrowser.Visible = True
  
  Do
  ' Wait till the Browser is loaded
  Loop Until oBrowser.readyState = READYSTATE_COMPLETE
  
  Set HTMLDoc = oBrowser.document
  
  HTMLDoc.all.loginID.Value = "User123"
  HTMLDoc.all.Password.Value = "Pass123"
  
  For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
  Debug.Print oHTML_Element.Name
  Next
  
  ' oBrowser.Refresh ' Refresh If Needed
  Err_Clear:
  If Err &lt;&gt; 0 Then
  Err.Clear
  Resume Next
  End If
  
  End Sub
  </code></pre>
  
  <p>I am trying to use vba to navigate through multiple websites and login to it respectively, thus, i am using my school portal as a trial for now. The code seems to work successfully in navigating to the site, but i can't input the user and password i want. It is the first time i am using vba to do web navigation and user authentication, i was hoping to find some help and advice here. Thanks.</p>