none
Open a website in Chrome RRS feed

  • Question

  • I need to be able to have a button in access open a website in Chrome regardless of the default browser.

    Below is how you do it in IE, but this other site needs to be in Chrome:

    On Error GoTo Matzke01E
      Dim i As Long
      Dim ie As Object
      Set ie = CreateObject("InternetExplorer.Application")
      With ie
        .Visible = True
        .navigate "https://www.iwco.com/"
        .resizable = True
      End With
      
      AppActivate ie.Name
    Exit Sub
    Matzke01E:

    • Edited by Mark Matzke Friday, December 22, 2017 3:24 AM added ie example
    Friday, December 22, 2017 3:22 AM

Answers

  • Hi Mark Matzke,

    in the same link, you can find the example for opening the chrome.

    Sub demo()
    
    
      Dim chromePath As String
    
      chromePath = """C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"""
    
      Shell (chromePath & " -url http:Microsoft.com")
    
    End Sub

    you just need to correct the path of Chrome if you get file not found error.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 25, 2017 2:22 AM
    Moderator

All replies

  • You need to use shell. See: https://stackoverflow.com/questions/5915325/open-google-chrome-from-vba-excel for a couple examples.

    Daniel Pineault, 2010-2017 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Friday, December 22, 2017 10:44 AM
  • Hi Mark Matzke,

    in the same link, you can find the example for opening the chrome.

    Sub demo()
    
    
      Dim chromePath As String
    
      chromePath = """C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"""
    
      Shell (chromePath & " -url http:Microsoft.com")
    
    End Sub

    you just need to correct the path of Chrome if you get file not found error.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 25, 2017 2:22 AM
    Moderator
  • Hi Mark Matzke,

    is your issue solved?

    I find that you did not follow up this thread after posting the issue.

    if your issue is solved then I suggest you to post your solution and mark it as an answer.

    if your issue is still exist then try to refer the solution given by the me.

    if then also you have any further questions then let me know about it.

    I will try to provide further suggestions to solve the issue.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, December 28, 2017 9:40 AM
    Moderator
  • Thank you Deepak!  Sorry for the delay over the holidays...  I do appreciate your help, it worked perfectly!
    Wednesday, January 3, 2018 3:42 PM