tags:

views:

27

answers:

1

i have a function that returns a string

on error, i would like it to return a specific value. how do i do this?

+4  A: 

Use On Error GoTo to branch to a specific label if an error occurs:

Function YourFunction() {
  On Error GoTo ErrorLabel
  ... your code ...
  Exit Function
  ErrorLabel:
    YourFunction = yourspecificvalue
}
Julien Lebosquain