All but one of my internet-based programs at work only function in Chrome. I have to keep my default as IE for the one program. I need the links in excel to open in Chrome. This is what I have, but it is not working. Where have I gone wrong? This is not for a specific URL, but any URLs opened in excel.
Sub showURL(browser As String, URL As String)
Dim pPath As String
Dim bPath As String
pPath = Environ("ProgramFiles")
If browser = "IE" Then
bPath = pPath & "\Internet Explorer\iexplore.exe"
ElseIf browser = "Chrome" Then
bPath = pPath & "\Chrome\chrome.exe"
Else
Exit Sub
End If
Call Shell(bPath & " " & URL, vbNormalFocus)
End Sub
Sub Testing()
Call showURL("IE", "http://www.tips.net")
Call showURL("Chrome", "http://excel.tips.net")
End Sub
Private Sub Workbook_Open()
End Sub
Sub showURL(browser As String, URL As String)
Dim pPath As String
Dim bPath As String
pPath = Environ("ProgramFiles")
If browser = "IE" Then
bPath = pPath & "\Internet Explorer\iexplore.exe"
ElseIf browser = "Chrome" Then
bPath = pPath & "\Chrome\chrome.exe"
Else
Exit Sub
End If
Call Shell(bPath & " " & URL, vbNormalFocus)
End Sub
Sub Testing()
Call showURL("IE", "http://www.tips.net")
Call showURL("Chrome", "http://excel.tips.net")
End Sub
Private Sub Workbook_Open()
End Sub