I need to trigger(return) an error event from a VBA function, then the calling function of this function can trigger On Error Go to call. E.g
function Test()
On Error Go to myError:
TestErr()
Exit Function
myerror:
Test = "Error Triggered"
End Function
Function TestErr()
?? 'How to Trigger error here
End Function
Thank You
Err.Raise 5, "optional error source" , "optional error description"
MSDN reference http://msdn.microsoft.com/en-us/library/aa164019%28office.10%29.aspx#odc_tentipsvba_topic3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With