Map is not working as expected in win11 by pushing code through vba

vipulgos

Active Member
Joined
Aug 17, 2002
Messages
335
Office Version
  1. 2010
Platform
  1. Windows
Hi

I am using this VBA successfully in Win10, Office 2010.

This link allows me to go to Firefox and open the links directly from VBA

But after changing my pc with Win11, Office2010 this is not working. sURL3 is working properly, but the sURL2 part, which is expected to open the location of the particular building under some village and some province (taluka) is not working.
No doubt it tries to open (I can see the expected url text in browser, but map coming back to my present location

Please guide me. Following is the essential part of code:

VBA Code:
Dim spath As String
Dim spath1 As String
Dim sURL As String
Dim sURL1 As String
Dim sURL2 As String
Dim sURL3 As String
Dim newvil
Dim dTaskID As Double

On Error GoTo 2:
spath = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" 'my browser

sURL2 = Replace(Range("buildname2").Value, " ", "+") & "+" & newvil & "+" & Range("taluka")

newvil = IIf(InStr(Range("village"), " "), Replace(Range("village"), " ", "+"), Range("village"))

sURL3 = Replace(Range("buildname3").Value, " ", "+") & "+" & newvil & "+" & Range("taluka") & "+Flat+sale"


dTaskID = Shell(spath & " " & sURL2 & " -new-tab " & sURL3, vbNormalFocus)
Exit Sub
2:
spath1 = "C:\Program Files\Mozilla Firefox\firefox.exe" 'my browser
sURL2 = Replace(Range("buildname2").Value, " ", "+") & "+" & newvil & "+" & Range("taluka")
sURL3 = Replace(Range("buildname3").Value, " ", "+") & "+" & newvil & "+" & Range("taluka") & "+Flat+sale"


dTaskID = Shell(spath1 & " " & sURL2 & " -new-tab " & sURL3, vbNormalFocus)

End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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