I'm getting a strange error in my user function library (UFL). I have a function that accepts a string and checks to see if it is a date like this:
Public Function psToDate(ByVal YYYYMMDD As String) As Date
'
' Convert the date held in the string to an actual date field
'
On Error GoTo ErrorTrap
YYYYMMDD = "12012001"
MsgBox "pstodate=" & YYYYMMDD
If IsDate(YYYYMMDD) Then
MsgBox "pstodate convert to date"
psToDate = CDate(YYYYMMDD)
MsgBox "pstodate returns date"
Else
psToDate = Null
MsgBox "pstodate returns null"
End If
Exit Function
ErrorTrap:
MsgBox "?Trapped error in psToDate"
End Function
-------------------------------------------------------
This fails on the IF ISDATE(....... statement. All of this looks good to me and the message I get is the dreaded "Memory Full" error.
The only thing I can think of is that CR supports the ISDATE function directly and maybe there is some type of conflict but that seems to be a long shot as that would preclude the use of almost all the VB functions.
Any ideas?
Public Function psToDate(ByVal YYYYMMDD As String) As Date
'
' Convert the date held in the string to an actual date field
'
On Error GoTo ErrorTrap
YYYYMMDD = "12012001"
MsgBox "pstodate=" & YYYYMMDD
If IsDate(YYYYMMDD) Then
MsgBox "pstodate convert to date"
psToDate = CDate(YYYYMMDD)
MsgBox "pstodate returns date"
Else
psToDate = Null
MsgBox "pstodate returns null"
End If
Exit Function
ErrorTrap:
MsgBox "?Trapped error in psToDate"
End Function
-------------------------------------------------------
This fails on the IF ISDATE(....... statement. All of this looks good to me and the message I get is the dreaded "Memory Full" error.
The only thing I can think of is that CR supports the ISDATE function directly and maybe there is some type of conflict but that seems to be a long shot as that would preclude the use of almost all the VB functions.
Any ideas?