Open a URL/Webpage in the Default Web Browser – VB.NET

The source code below will open the computers default Webbrowser with the specified link in Visual Basic.NET.

'Simply opens the default web browser and navigates to the specified url.
'This works with all versions of .NET including the latest 2005/08/2010 versions.

Dim webAddress As String = ""


37 thoughts on “Open a URL/Webpage in the Default Web Browser – VB.NET

  1. Kolklik

    This is by far the best way to open a website if you ask me, theres ofcourse also:

  2. Jake

    Just what I needed :). The API call for opening a default web browser seems to only work on XP, :/ but this should work on other platforms as well :).

  3. rahul

    hi ! this is a good example. thanks.
    Also I would like to know how i can open a URL using an activeX control in vb 2008?

  4. DMK

    Thanks. Exactly what I needed. This way I can open links with ampersands in it. That did not work with my original code.

  5. nuno

    just great… for so long that i’ve looking for something like this. And all the examples were so hard to understand! but now, just two lines! just great! thanks!!!

    eveyone in portugal is more happy now because of you! lol

  6. Brian

    This is great. However, how do I close the webpage that I’ve opened? What is the command to do that task?

  7. Jason Post author

    Hi, you can use API to do it. There is DestroyWindow API that should work.

    Public Declare Function DestroyWindow Lib “user32” Alias “DestroyWindow” (ByVal hwnd As IntPtr) As Integer

    You just need to get the handle of the window you want to close.

    Also there is the process class in the .net framework you can use. For Example:


    One of those method should get you started. 🙂


  8. macieksoft

    i have sharp deceloop no visual studio, this is my error:

    Nie mo?na skonwertowaS wartotci typu „String” na „System.Diagnostics.ProcessStartInfo”. (BC30311) – C:UsersAdministratorDocumentsSharpDevelop ProjectsmcwdsremotepaMainForm.vb:28

    can anyone help me how i can convert string to

  9. paolo

    hi can you help me out on this i want to send a url to the web browser using vb 2008 when i press a send button but i dont want to open the webrowser i just want to send a API command to process it without opening the browser? and how can i get the response from it like if respose is 0 then it’s sending message successfull

  10. Darnel

    Any way to use this function without actually navigating to the opened page. I am trying to open a series of pages from a launching page.


  11. Jason Post author

    Hi Darnel, I’m not exactly sure what you mean.

    Do you mean that you want each url in a list to open a separate browser window or tab? LMK with more details and I can try to help you. Thanks 🙂


  12. Praveen

    I am using a forms.webbrowser control on my application to whichI am passing all the values. I wan tot be able to launch the browser in my local system with the URL i provided. but still I wan to use only forms.webbrowser instead of controls.webbrowser.. any thoughts?


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.