title: VBA macro to open Mozilla Firefox
body: <p>Hi I have come up with a code, which will open Internet Explorer, navigate to a website, enter user id and password and finally click the login button.</p>
  
  <p>The code is:</p>
  
  <pre><code>Public Sub LOGIN()
  
      Dim objIE As SHDocVw.InternetExplorer 
      Dim htmlDoc As MSHTML.HTMLDocument 
      Dim htmlInput As MSHTML.HTMLInputElement
      Dim htmlColl As MSHTML.IHTMLElementCollection
  
      Set objIE = New SHDocVw.InternetExplorer
  
      With objIE
          .Navigate "https://website.co.in" ' Main page
          .Visible = 1
          Do While .READYSTATE &lt;&gt; 4: DoEvents: Loop
          Application.Wait (Now + TimeValue("0:00:02"))
  
          Set htmlDoc = .document
          Set htmlColl = htmlDoc.getElementsByTagName("INPUT")
          Do While htmlDoc.READYSTATE &lt;&gt; "complete": DoEvents: Loop
          For Each htmlInput In htmlColl
              If htmlInput.Name = "UserName" Or htmlInput.Type = "text" Then
                  htmlInput.Value = "Adidas"
              Else
                 If htmlInput.Name = "password" Then
                   htmlInput.Value = "Daddy123"
  
                  End If
              End If
          Next htmlInput
  
          Set htmlDoc = .document
          Set htmlColl = htmlDoc.getElementsByTagName("input")
          Do While htmlDoc.READYSTATE &lt;&gt; "complete": DoEvents: Loop
          For Each htmlInput In htmlColl
              If Trim(htmlInput.Type) = "submit" Then
                  htmlInput.Click
                  Exit For
              End If
          Next htmlInput
      End With
  End Sub
  </code></pre>
  
  <p>But as the website for which I have created this script doesn't support Internet Explorer I want to open the same in Firefox. I am clueless and I have not tried anything so far. Please help me out.</p>