+ Reply to Thread
Results 1 to 7 of 7

How to open URL or local html file with command button?

  1. #1
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    How to open URL or local html file with command button?

    What is the code to open a URL or local html file with a command button?

    Thank you for helping me, I'm a rookie.

    Excel 2000
    Last edited by proepert; 01-16-2010 at 07:00 PM. Reason: Added the version of Excel.

  2. #2
    Registered User
    Join Date
    02-18-2005
    Posts
    16

    Re: How to open URL or local html file with command button?

    you can create a userform and add WEB browser support and user the code

    WebBrowser1.Navigate "https://www.yahoo.com"

  3. #3
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Re: How to open URL or local html file with command button?

    Quote Originally Posted by anwarbham View Post
    you can create a userform and add WEB browser support and user the code

    WebBrowser1.Navigate "https://www.yahoo.com"
    Thank you for the quick reply.

    In this case I don't want to use a from, just have a command button on the worksheet that I would like to open a URL.

    However, because I'm learning, can you explain more about how I "add WEB browser support" to a user form? I have created a few forms, but I don't see any property or method for adding support for the WEB browser.

    I'm using Excel 2000.

  4. #4
    Registered User
    Join Date
    02-18-2005
    Posts
    16

    Re: How to open URL or local html file with command button?

    you can add this to the button and it will open yahoo in a new IE page

    ActiveWorkbook.FollowHyperlink Address:="http://www.yahoo.com"

    if you want to go down the user form page create a new user form on the controls toolbox
    right click and select ADD aditional controls scroll down and select the option that says MS web browser you can now add a web browser window to the form ...

    navigate via the name of the control so it will prob be called webbrowser1

    so webbrowser1.navigate "web address in here "

  5. #5
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Re: How to open URL or local html file with command button?

    Thank you very much.

  6. #6
    Registered User
    Join Date
    09-01-2010
    Location
    Barcelona, Catalonia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: How to open URL or local html file with command button?

    I have a following question on this matter.

    ActiveWorkbook.FollowHyperlink Address:="http://www.yahoo.com"

    This works very well, but the problem is that the URL I want to open is sitting in a cell (made with the concatenate funtion). How do I add the reference in Visual Basic to make it pick the url in the A6 cell, for example?

    thanks

  7. #7
    Registered User
    Join Date
    10-04-2010
    Location
    amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    1

    Talking Re: How to open URL or local html file with command button?

    Quote Originally Posted by mai9 View Post
    I have a following question on this matter.

    ActiveWorkbook.FollowHyperlink Address:="http://www.yahoo.com"

    This works very well, but the problem is that the URL I want to open is sitting in a cell (made with the concatenate funtion). How do I add the reference in Visual Basic to make it pick the url in the A6 cell, for example?

    thanks
    you can try this:
    ActiveWorkbook.FollowHyperlink Address:= Cells(rowIndex, coloumnIndex).Value

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1