Access/VBA Library

followLink Method

Select a hyperlink using its caption and perform a 'click' on this element. All hyperlinks (tagname 'a') are searched on the current webpage and scanned. The number of searched links can be reduced by specifying a classname.


clsIE.followLink( caption [, className] )
Name Type Description
clsIE   The name of an object of type clsIE
caption String Required. The caption or innerText of a hyperlink.
className String Optional. The name of the CSS-class the hyperlink should contain.
Default: ""
Return value

Boolean : True when a hyperlink has been found and clicked, False otherwise.



  • When multiple hyperlinks matches the given criteria, only the first one will be selected.
  ' Get the Weather foracast of BBC
  Dim IE As New clsIE

  IE.location = ""
  If IE.FollowLink("Weather") Then
      MsgBox "See website for Weather forecast!"
      MsgBox "No Weather forecast today:)!"
  End If