title: Creating a macro in HTML
body: <p>I want to create a web page which redirects a user to a log in page and automatically signs them in using a single log in which I have. (I do not want them to have this log in information - I just want it done automatically). </p>
  
  <p>I have created the macro using VBA and it works there. I wanted to know if there is anyway of implementing this in my HTML code or will I have to re-write the macro in another coding language? </p>
  
  <p>The VBA code I have is:</p>
  
  <pre><code>Sub Test()
  
      Const cURL = "http://www.google.com" 'Enter the web address here
      Const cUsername = "user1" 'Enter your user name here
      Const cPassword = "*****" 'Enter your Password here
  
      Dim IE As InternetExplorer
      Dim doc As HTMLDocument
      Dim LoginForm As HTMLFormElement
      Dim UserNameInputBox As HTMLInputElement
      Dim PasswordInputBox As HTMLInputElement
      Dim SignInButton As HTMLInputButtonElement
      Dim HTMLelement As IHTMLElement
      Dim qt As QueryTable
  
      Set IE = New InternetExplorer
  
      IE.Visible = True
      IE.Navigate cURL
  
      'Wait for initial page to load
  
      Do While IE.ReadyState &lt;&gt; READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
  
      Set doc = IE.Document
  
      'Get the only form on the page
  
      Set LoginForm = doc.forms(0)
  
      'Get the User Name textbox and populate it
      'input name="Email" id="Email" size="18" value="" class="gaia le val" type="text"
  
      Set UserNameInputBox = LoginForm.elements("user")
      UserNameInputBox.Value = cUsername
  
      'Get the password textbox and populate it
      'input name="Passwd" id="Passwd" size="18" class="gaia le val" type="password"
  
  
      Set PasswordInputBox = LoginForm.elements("pass")
      PasswordInputBox.Value = cPassword
  
      'Get the form input button and click it
      'input class="gaia le button" name="signIn" id="signIn" value="Sign in" type="submit"
  
      Set SignInButton = LoginForm.elements("LOG_ON_BTN")
      SignInButton.Click
  
      'Wait for the new page to load
  
      Do While IE.ReadyState &lt;&gt; READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
  
      End Sub
  </code></pre>
  
  <p>If anyone knows how to implement macros in html that would great? </p>