Command Button Launches Default Browser Via One Line of VBA Code

Solved/Closed
ProWHP Posts 3 Registration date Saturday July 7, 2018 Status Member Last seen June 2, 2021 - Jun 2, 2021 at 03:53 PM
TrowaD Posts 2913 Registration date Sunday September 12, 2010 Status Moderator Last seen November 21, 2022 - Jun 3, 2021 at 11:56 AM
I have a userform that allows me to use a webbrowser within it, however sometimes due to compatibility issues I need to use microsoft edge and use it outside of the userform. I had previously fixed the issue however the entire workbook was completely deleted and I forgot to write it down.

I could click on the command button and it would automatically launch edge and navigate to the website I specified. The only thing I can get to work is the web browser within the userform like you typically would:

me.webbrowser1.navigate "google.com"

What's one line of VBA code I could use to launch edge instead? I just can't figure it out again! Thanks for any advice :)
Related:

1 reply

TrowaD Posts 2913 Registration date Sunday September 12, 2010 Status Moderator Last seen November 21, 2022 541
Updated on Jun 3, 2021 at 11:57 AM
Hi ProWHP,

Here is the requested code line:
Shell ("C:\Program Files\Microsoft Edge\Edge.exe" & " " & "google.com")


Adjust the path to your .exe file for Edge.

Best regards,
Trowa

0