Followhyperlink problem

vipulgos

Active Member
Joined
Aug 17, 2002
Messages
335
Office Version
  1. 2010
Platform
  1. Windows
Dear all,
I am trying below mentioned code to use it in non-default web browser, i.e. Firefox

Code:
Sub Map_Click()


Dim sPath As String
Dim sURL As String
Dim dTaskID As Double


sPath = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" 'my browser
sURL = Range("newadress")
dTaskID = Shell(sPath & " " & sURL, vbNormalFocus)


If dTaskID = 0 Then
MsgBox "Could not open browser"
End If


End Sub

Actually my Range("newadress") is looks like this:
https://www.google.co.in/maps/place/royal palm, goregaon, mumbai

But when I run the code Four Firefox windows get open
with addresses as under:

1) https://www.google.co.in/maps/place...x3c04a720fb60cd08!8m2!3d19.199489!4d72.846165
2) http://www.palm,.com/
3) http://www.goregaon,.com/
and 4) http://mumbai/

I just want the firefox to show me link as:
https://www.google.co.in/maps/place/royal palm, goregaon, mumbai

Where I am going wrong?

But when I use the code with default browser as under:
Code:
ActiveWorkbook.FollowHyperlink Address:=Range("newadress").Value, NewWindow:=True
It open in Chrome(my default browser), exactly as I wanted....
 
Last edited:

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Why no answers for my last many posts?
Is there anything wrong on my side?
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,790
Members
448,994
Latest member
rohitsomani

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top