The following function was suggested to me:
' Defines a forced casting function, which "casts" anything that it can't detect as a number to zero.
Function MakeInteger(val)
If IsNumeric(val) Then
MakeInteger = CInt(val)
Else
MakeInteger = 0
End If
End Function
Unfortunately there appear to be some things that return true for IsNumeric() but still can't be cast as an int. Is there any better check to use?