Leave cell value untouched if Custom Function errors
I have a custom function that uses arguments from the user's worksheet to
find data in an external Access database using ADO, then return it to the
relevant cell. It works fine, but I want to be able to ensure that the custom
function leaves the cell value *untouched* (rather than returning an error
value) if the VBA cannot make the connection to the Access database (e.g. if
the user can't access the database for some reason).
I've tried using Application.Caller to get the cell's original value, but
this doesn't seem to work. Can anyone help?
Thanks,
SB
|