Opening Chrome via VBA

BrianExcel

Well-known Member
Joined
Apr 21, 2010
Messages
975
Hi,
I have looked up multiple different threads with multiple different methods and can't get this to work. I am trying to open a Chrome Window and navigate to maps.google.com, but each time I try to run the code (from a button on a userform), I get the following error:

Run-Time error '53'"

File Not Found


Here is the simple code I am trying to run...

VBA Code:
Sub CommandButton1_Click()
Dim URL As String, FFPATH As String

URL = "https://www.google.com"
FFPATH = "C:\Program Files (x86)\Google\Chrome\Application"

Shell FFPATH & " " & URL, vbNormalFocus

End Sub

Any thoughts?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Okay, so I got Chrome to open, but the hyperlink I am using (along with latitude and longitude) are not inputting, even though the string says it's there.

Right now I am navigating to:

VBA Code:
Shell (chromePath & " -url https://google.com/maps/@" & UserForm1.txtLatitude & "," & UserForm1.txtLongitude), vbMaximizedFocus

But the latitude and longitude don't seem to be "taking"....it just navigates me to my home's location....how do I navigate to a specific lat & lon using code?
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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