This code has been put forward as a KB sample and one of the testers has a problem with using the Microsodt Internet Controls Library. Can people please test this and let me know if it works and what system detauils (Excel and Windows) they are using.

This code runs a google search for "vbax kb". If a valid website is found via a regular expressions parsing search, then this web page is opened.
  1. Run the macro SetRefs by going to Tools-Macro-Macros and double-click SetRefs. This sets the references to the VBscript Regular Expressions 5.5 and Internet Controls libraries
  2. Run the macro AutomateIE by going to Tools-Macro-Macros and double-click AutomateIE.
[vba]
Sub AutomateIE()
Dim ie As InternetExplorer
Dim RegEx As RegExp, RegMatch As MatchCollection
Dim MyStr As String
Set ie = New InternetExplorer
Set RegEx = New RegExp
'Search google for "vbax kb"
ie.Navigate "http://www.experts-exchange.com"
'Loop unitl ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
'String to parse google search for a VBAX reference
With RegEx
.Pattern = "www.vbaexpress.+?html"
.MultiLine = True
End With
'return text from google page
MyStr = ie.Document.body.innertext
Set RegMatch = RegEx.Execute(MyStr)
'If a match to our RegExp searchstring is found then launch this page
If RegMatch.Count > 0 Then
ie.Navigate RegMatch(0)
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
MsgBox "Loaded VBAX link"
ie.Visible = True
Else
MsgBox "No VBAX link found"
End If
Set RegEx = Nothing
Set ie = Nothing
End Sub
Sub SetRefs()
Dim ObRef
On Error Resume Next
' Adds VBscript ref and Internet Controls
With ThisWorkbook.VBProject
.References.AddFromGuid _
"{3F4DACA7-160D-11D2-A8E9-00104B365C9F}", 5, 5
.References.AddFromGuid _
"{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}", 1, 1
End With
End Sub

[/vba]