Excel Hyperlinks() Problem

John Aves 21 Reputation points
2021-01-15T13:05:28.487+00:00

Recently the command "Worksheets("R_C_C").Range("Z1:AA2").Hyperlinks(2).Follow" which use to access a Workbook on our website, has started to call up the web browser instead of the Workbook it called up previously. As the next command uses the new workbook, it causes the Sub to goto the error page and stop. Has there been a major change in the functionality of the Hyperlinks routine? I have Microsoft 365 but many of the user have other copies up to 5 years old. The Hyperlink is “http://www.???????.org/uploads/Handicaps/SheetHandicaps.xls”

{count} votes

Accepted answer
  1. Viorel 114.7K Reputation points
    2021-01-18T08:44:07.623+00:00

    According to some articles (https://www.bing.com/search?q=excel+workbook+open+url), it is possible to open a workbook using the Web address of the document. Check this fragment:

    Application.DisplayAlerts = False
    Workbooks.Open "http://....../SheetHandicaps.xls"
    Application.DisplayAlerts = True
    

    If it works, maybe you can use it in VBA instead of Follow.


1 additional answer

Sort by: Most helpful
  1. John Aves 21 Reputation points
    2021-01-19T11:49:15.82+00:00

    Many thanks for that @Viorel . It worked like a dream. I will have to change how the file path is accessed at other points of the code to make it easier to change the filename if required, but it works.

    0 comments No comments