LegalAlien
Perch
Here is a part of my code used in a search function:
I'm getting an 'Invalid_use_of_Null' error on line 66, which is:
Any clue why? This code was working fine some time ago. I can't think of anything I've changed to create this error, but I've obviously done something
Function InstrWord(start, Text, search, compareMethod)
Dim index
Dim charcode
InstrWord = 0
index = start - 1
Do
index = Instr(index + 1, Text, search, compareMethod)
If index = 0 then exit function
If index > 1 then
charcode = asc(ucase(mid(Text, index - 1, 1)))
else
charcode = 32
end if
If charcode < 65 or charcode > 90 then
charcode = asc(ucase(mid(Text, index + len(search), 1)) & " ")
If charcode < 65 or charcode > 29 then
InstrWord = index
Exit Function
End If
End If
Loop
End Function
I'm getting an 'Invalid_use_of_Null' error on line 66, which is:
charcode = asc(ucase(mid(Text, index + len(search), 1)) & " ")
Any clue why? This code was working fine some time ago. I can't think of anything I've changed to create this error, but I've obviously done something