我需要从VBA函数触发(返回)错误事件,然后该函数的调用函数可以触发On Error Go来调用.例如
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
Run Code Online (Sandbox Code Playgroud)
谢谢
Rus*_*ang 23
Err.Raise 5,"可选错误源","可选错误描述"
MSDN参考http://msdn.microsoft.com/en-us/library/aa164019%28office.10%29.aspx#odc_tentipsvba_topic3