UDF Error Handling is ignored. Not for everyone?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have created a new function to try to recreate an example function
that mimics my intent:

Public Function HelloWorld(causeError As Boolean) As String


On Error GoTo ErrorHandler
If (causeError) Then
Err.Raise 1234
Else
HelloWorld = "Hello World"
End If


FunctionExit:
Exit Function


ErrorHandler:
Err.Clear
HelloWorld = "ERROR HAPPENED"
Resume FunctionExit


End Function

For me;
=HelloWorld(FALSE) returns "Hello World"
=HelloWorld(TRUE) returns #VALUE!

For someone else, they get;
=HelloWorld(FALSE) returns "Hello World"
=HelloWorld(TRUE) returns "ERROR HAPPENED"

What could be the problem? I am using Excel 2003, SP2

.



Relevant Pages

  • Re: Dir function to check for file not reliable
    ... > Function bFileExists3(ByVal sFile As String) As Boolean ... > On Error GoTo 0 ...
    (microsoft.public.excel.programming)
  • Re: Simple but baffling question
    ... >> Public Function FileExists(ByVal sFile as String) As Boolean ... >> On Error Goto 0 ... >>> This is in a VB6 ActiveX dll and used in Excel VBA. ...
    (microsoft.public.vb.general.discussion)
  • Re: How do I get back path names like "C:progra~1visual~1filename.doc"
    ... > Public Function DirExistsAs Boolean ... > On Error GoTo DirExists_Error ... > Dim bRet As Boolean ... Public Function DirExists(ByVal PathName As String) As Boolean ...
    (microsoft.public.vb.general.discussion)
  • Re: Is open.
    ... > Function Workbook_Open(WbookName As String) As Boolean ... > Dim wBookCheck As Workbook ... > On Error GoTo 0 ...
    (microsoft.public.excel)
  • Re: UDF/VBA Function, trap error, avoid #VALUE!
    ... Public Function HelloWorld(causeError As Boolean) As String ... On Error GoTo ErrorHandler ... HelloWorld = "ERROR HAPPENED" ...
    (microsoft.public.excel.programming)