title: How to submit login credentials?
body: <p>This is relating to the submit button of the login screen</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;TD background=/frontend/images/greenback.gif width=302&gt;&lt;INPUT type=submit value="Login now" name=submit&gt; &lt;/TD&gt;
  </code></pre>
  
  <p>I enter the username and password into the box but the script stops at <code>.Submit</code></p>
  
  <pre class="lang-vb prettyprint-override"><code>Sub GetTable()
  
  'Kills any open IE windows.
  On Error GoTo Ignore
  Call IE_Sledgehammer
  Ignore:
  
  Dim ieApp As InternetExplorer
  Dim ieDoc As Object
  Dim ieTable As Object
  Dim clip As DataObject
  Dim UserName As String, Password As String
  
  'Create anew instance of ie
  Set ieApp = New InternetExplorer
  
  'Debugging
  ieApp.Visible = True
  
  'Opening this page prompts login screen
  ieApp.Navigate "CANNOT SHARE, INTERNAL WORK SITE"
  
  'When busy - wait
  Do While ieApp.Busy: DoEvents: Loop
  Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
  
  'Pop up window
  On Error GoTo skip_Popup
  ieApp.Document.all.item("submitBn").Focus
  SendKeys "~"
  skip_Popup:
  
  'Login script
  On Error GoTo Skip_Login
  Set ieDoc = ieApp.Document
  
  'fill in the login form – View Source from your browser to get the control names
  With ieDoc.forms(0)
      .UserName.Value = "test1"
      .Password.Value = "test2"
      .Submit
  End With
  
  Do While ieApp.Busy: DoEvents: Loop
  Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
  Skip_Login:
  
  'Copy page Info
  Set ieDoc = ieApp.Document
  Set ieTable = ieDoc.all.item
  
  'Copy Paste the page
  If Not ieTable Is Nothing Then
      Set clip = New DataObject
      clip.SetText "" &amp; ieTable.outerHTML &amp; ""
      clip.PutInClipboard
  
      'Location of data
      Sheets("Raw Data").Range("E2").PasteSpecial "text"
  End If
  
  'Delete any form controls that make it into the sheet
  Sheets("Raw Data").DrawingObjects.Delete
  
  'Kills ALL IE windows
  Call IE_Sledgehammer
  Set ieApp = Nothing
  End Sub
  </code></pre>
  
  <p>Also this is not critical, how do I just select the table on the page and not everything else? It doesn't have a name so I am stuck with this one also. </p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;table cellspacing="1" cellpadding="2" align="center" border="0" width="400"&gt;
  </code></pre>