Google Chrome VBA

  • Hi Guys



    Now to open two websites, I use the following code:
    Code:


    Code
    Shell ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe -url www.facebook.com")
    Shell ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe -url www.google.com")


    However, they open in one window by two tabs, how could I make them open in two windows
    And how can I make them open in two sessions?



    This topic was originally posted here:
    https://www.mrexcel.com/forum/excel-...hrome-vba.html

  • Hi Magdoulin,


    Use the Chrome --new-window command line switch in your Shell statement...

    Code
    Public Sub ChromeNewWindows()
    
    
    Shell ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --new-window -url www.facebook.com")
    Shell ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --new-window -url www.google.com")
    
    
    End Sub


    Tested OK in Excel 2016 32Bit.


    Regards,


    Tom Rowe

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!