How to open Firefox and Google Chrome with Excel VBA. Watch the video below:
We may need to fire up browsers like Firefox and Google Chrome via Excel VBA because these are the only web browsers allowed in some companies. The code below helps us to automatically open Firefox and Google Chrome automatically to perform further actions. In the process we also learn some more interesting macro coding in Excel.
Option Explicit
Sub StartFireFoxAndChrome()
VBA.Shell “Explorer.exe C:\Program Files (x86)\Mozilla Firefox\firefox.exe”, vbMaximizedFocus
Application.Wait Now + TimeValue(“00:00:10”)
SendKeys “copy data from sheet1 to sheet2”
Application.Wait Now + TimeValue(“00:00:02”)
SendKeys “~”
Application.Wait Now + TimeValue(“00:00:05”)
SendKeys “%{F4}”
Application.Wait Now + TimeValue(“00:00:02”)
VBA.Shell “Explorer.exe C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”, vbMaximizedFocus
Application.Wait Now + TimeValue(“00:00:05”)
SendKeys “copy data from sheet1 to sheet2”
Application.Wait Now + TimeValue(“00:00:01”)
SendKeys “~”
End Sub

Further reading on SendKeys Statement