+ Reply to Thread
Results 1 to 5 of 5

URL link in message box

  1. #1
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    URL link in message box

    Hi All,

    I've done a bit of reading up in this topic and managed to find and modify code for 2 methods to activate a link in a message box.

    Method 1: Using a simple message box sourcing code here: https://stackoverflow.com/questions/...n-a-messagebox
    Please Login or Register  to view this content.
    triggered when a cell value is changed via a drop down box
    Please Login or Register  to view this content.

    Method 2: Using a more complex userform method which i don't fully understand to be honest but it looks great. Everything is perfect but unfortunately i can't quite get the hyperlink to execute. When clicked it goes to windows explorer rather than website link added ("www.google.com") for test purposes.

    Working test file attached with code for both which should be quite self explanatory.

    How to use:

    edit: If green cell D7 is changed it will bring up the method 1 message box, if yellow cell D5 is changed it will bring up method 2 message box.

    At the moment i'm using Method 1 but would prefer to use Method 2 if i can get it to work.
    Attached Files Attached Files
    Last edited by Gti182; 06-06-2017 at 06:45 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: URL link in message box

    Your second method worked fine for me. Opened up in my default browser.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: URL link in message box

    Thanks for testing 6StringJazzer. That odd, does it open the google page or just the browser? Mine opens up my homepage in internet explorer using method 2. Method 1 opens up google in chrome as is like

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: URL link in message box

    If yellow cell D7 is changed it will bring up the method 1 message box, if green cell D5 is changed it will bring up method 2 message box.
    Your description is a bit scrambled. The code you labelled as Method 1 above runs when the green box in D7 is updated.

    Sub Yellow is triggered by D5, the yellow cell. Your original code explicitly opens Windows Explorer. Whoever wrote the code probably thought Explorer.exe referred to Internet Explorer. I have modified your code to use a Shell command, the same way the other option works.

    Module1 had a superfluous copy of the code from the form, which is useless and confusing, so I removed it.

    I modified the command in the Yellow version (the form you like) to use a command similar to the Green version. It will use your default browser.

    In the Sub HLinkMsgBox, there is no need for a With for the form. Every reference will default to objects in the form. I removed it.

    I strongly recommend to everyone that they declare variables. Doing so prevents a lot of bug and runtime errors.

    They both work now, see attached.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: URL link in message box

    That works great 6StringJazzer

    Quite right my description in the original post was incorrect, now updated for anyone interested.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Pop up message and go to link
    By Anisusa in forum Excel General
    Replies: 7
    Last Post: 01-04-2017, 10:04 AM
  2. link pop-up message to a cell
    By ash369ster in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2015, 07:49 AM
  3. [SOLVED] How to pop up a warning message before any Excel automatic update link reminder message
    By billj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2013, 10:41 AM
  4. Disable Automatic Link Message
    By Jenn68 in forum Excel General
    Replies: 0
    Last Post: 06-13-2012, 09:31 AM
  5. Automatic Link Update message - Why?
    By ilovedurango in forum Excel General
    Replies: 2
    Last Post: 07-12-2007, 09:07 PM
  6. How to get rid of an link message in Excel?
    By Jenny in forum Excel General
    Replies: 4
    Last Post: 07-14-2005, 12:05 PM
  7. Link can not be updated message
    By Cindy in forum Excel General
    Replies: 0
    Last Post: 06-06-2005, 03:05 PM

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