+ Reply to Thread
Results 1 to 5 of 5

User form button to open a URL?

Hybrid View

  1. #1
    Registered User
    Join Date
    08-29-2011
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010Win, 2011Mac
    Posts
    4

    User form button to open a URL?

    Hi,
    I'm working on simple user forms. What I would like to do is have a button that opens up a web address, when the user clicks the button. Is this related to the Hyperlink function, or one of the HTML functions (I was just looking through the Object Browser)? Or, is this even possible from a user form?

    Thank you for the help, you all are great!

    Private Sub Button_Click()
    
    www.example.com
    
    End Sub
    Last edited by frogger4; 11-01-2011 at 02:29 AM.

  2. #2
    Registered User
    Join Date
    10-02-2011
    Location
    Los Angeles, USA
    MS-Off Ver
    2010 Home Version (doesn't include Access and Outlook )
    Posts
    22

    Re: User form button to open a URL?

    Does something like this suit your needs?

    Private Sub CommandButton2_Click()
        ActiveWorkbook.FollowHyperlink ("http://www.excelforum.com"), NewWindow:=True
    End Sub

  3. #3
    Registered User
    Join Date
    08-29-2011
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010Win, 2011Mac
    Posts
    4

    Re: User form button to open a URL?

    Perfect, thank you!

  4. #4
    Registered User
    Join Date
    01-22-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    2

    Re: User form button to open a URL?

    Hi,

    I also tried the same solution for opening google.com. Full code:

    Dim link As String
    link = "www.google.com"
    ActiveWorkbook.FollowHyperlink Address:=link, NewWindow:=True

    it says, could not open the file.

    Any suggestion will be appreciated.

    Thanks in advance.
    Saurabh

  5. #5
    Registered User
    Join Date
    01-22-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    2

    Re: User form button to open a URL?

    Hi,

    I guess the issue was with my window setting. I resolved it by following: http://support.microsoft.com/kb/218153

    Thanks,
    Saurabh

+ 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