Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello!
I have a user defined function to write data back to a database in my Excel sheet. I return a smal text to show the user if the function was successful or not. When I set the return value of the function in regular code, it works fine. But, when something goes wrong, the execution goes to an error handler, the function does not return the string I set anymore. I have the code: Public Function WriteData() on error goto ErrorHandler .. .. calculations .. .. WriteData = "OK" 'This is returned correct to the cell goto End ErrorHandler: WriteData = "Not OK" 'This returns #VALUE to the cell End: End Function Can someone tell me the reason of this behavior, and/or what I am doing wrong? Regards DagL |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
UserDefined Functions | Excel Programming | |||
Returning range object from custom functions | Excel Programming | |||
Functions returning multiple answers | Excel Programming | |||
Returning Error from Functions | Excel Programming | |||
Passing Parameters to Userdefined Functions | Excel Programming |