Graham,
What is/was your intent with the parts of your function that I've stetted out below:
Code:
Function TestRegExp(strFind As String, strText As String) As Boolean
Dim objRegExp As Object
'Dim objMatch As Object
'Dim colMatches As Object
TestRegExp = False
Set objRegExp = CreateObject("VBScript.RegExp")
objRegExp.Pattern = strFind
objRegExp.IgnoreCase = True
objRegExp.Global = True
If (objRegExp.Test(strText) = True) Then TestRegExp = True
' Set colMatches = objRegExp.Execute(strText)
' For Each objMatch In colMatches
' TestRegExp = True
' Exit For
' Next
' End If
Set objRegExp = Nothing
' Set colMatches = Nothing
' Set objMatch = Nothing
End Function