+ Reply to Thread
Results 1 to 7 of 7

FollowHyperLink Vba Anchor Issues

  1. #1
    Registered User
    Join Date
    07-12-2018
    Location
    In the land of TBHQ
    MS-Off Ver
    2013
    Posts
    51

    FollowHyperLink Vba Anchor Issues

    Hello,
    I have this simple script to explain the issue I'm running into.

    To explain this better I'll use the example

    PHP Code: 
    Sub test()
    Dim URL As String
    URL 
    "https://www.rapidtables.com/web/html/link/html-anchor-link.html#same-page"
    ActiveWorkbook.FollowHyperlink Address:=URL

    End Sub 
    This example loads the URL with https://www.rapidtables.com/web/html...0-%20same-page

    Why is the #=%20-%20? Can some assist? Thank you

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: FollowHyperLink Vba Anchor Issues

    Some characters are not allowed in url codes and need to be replaced.

    https://en.wikipedia.org/wiki/Percent-encoding

  3. #3
    Registered User
    Join Date
    07-12-2018
    Location
    In the land of TBHQ
    MS-Off Ver
    2013
    Posts
    51

    Re: FollowHyperLink Vba Anchor Issues

    Thank you, this explain what is happening much better. Now I need to make it work. This is what I have tried

    PHP Code: 
    Sub test()
    Dim URL As String
    URL 
    "https://www.rapidtables.com/web/html/link/html-anchor-link.html%23same-page"
    ActiveWorkbook.FollowHyperlink Address:=URL
    End Sub 
    What is the escape character to make it read as a # sign. Sorry, didn't stay at the holiday inn express last night.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: FollowHyperLink Vba Anchor Issues

    Do you have to change it? Can you not just keep it as what you had in Post #1?

  5. #5
    Registered User
    Join Date
    07-12-2018
    Location
    In the land of TBHQ
    MS-Off Ver
    2013
    Posts
    51

    Re: FollowHyperLink Vba Anchor Issues

    Quote Originally Posted by davesexcel View Post
    Do you have to change it? Can you not just keep it as what you had in Post #1?
    I have to change it because it does this to the linkAttachment 660320

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: FollowHyperLink Vba Anchor Issues

    Oh, that is strange.
    Both your codes work for me, your first code takes me to the actual web paragraph, your second code takes me to the web page
    I'll bring in the troops.

  7. #7
    Registered User
    Join Date
    07-12-2018
    Location
    In the land of TBHQ
    MS-Off Ver
    2013
    Posts
    51

    Re: FollowHyperLink Vba Anchor Issues

    After you had mentioned that it was strange, I decided to test on another computer in the office. It worked fine...so this is isolated to my computer. The way I made it work was with a shell command and it worked perfectly fine. Thank you for your help.

+ 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. [SOLVED] Macro for FollowHyperLink
    By Neilesh Kumar in forum Excel General
    Replies: 17
    Last Post: 05-03-2017, 09:07 AM
  2. [SOLVED] I need some Help with FollowHyperlink please (Error 432)
    By Trefor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2006, 07:25 AM
  3. Application.FollowHyperlink Query
    By n_s_simpson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2006, 06:41 AM
  4. FollowHyperlink failing
    By Andrew Fiddian-Green in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-09-2006, 08:10 AM
  5. FollowHyperlink automatically
    By Pieter-Jan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-13-2005, 01:50 PM
  6. [SOLVED] FollowHyperlink Method
    By Keith in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-06-2005, 11:05 AM
  7. FollowHyperlink Method
    By ngedwin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2005, 01:45 AM

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