我的错误处理程序如下:
Public Function HandleErrors()
Function HandleErrors(iErrNum) As Integer
Select Case IAction
Case 5
'Invalid procedure call
MsgBox Error(iErrNum) & "Contact Help Desk."
IAction = 2
Case 7
'Out of memory
MsgBox "Close all unnecessary applications."
IAction = 1
Case 11
'Division by zero
MsgBox "Zero is not a valid value."
IAction = 1
Case 48, 49, 51
'Error in loading DLL
MsgBox iErrNum & "Contact Help Desk"
IAction = 5
Case 57
'Device I/O error
MsgBox "Insert Disk in Drive A."
IAction = 1
Case Else
MsgBox "Unrecoverable Error."
IAction = 5
End Select
ErrorHandle = IAction
End Function
Public Function HandleErrors()
Function HandleErrors(iErrNum) As Integer
Select Case IAction
Case 5
'Invalid procedure call
MsgBox Error(iErrNum) & "Contact Help Desk."
IAction = 2
Case 7
'Out of memory
MsgBox "Close all unnecessary applications."
IAction = 1
Case 11
'Division by zero
MsgBox "Zero is not a valid value."
IAction = 1
Case 48, 49, 51
'Error in loading DLL
MsgBox iErrNum & "Contact Help Desk"
IAction = 5
Case 57
'Device I/O error
MsgBox "Insert Disk in Drive A."
IAction = 1
Case Else
MsgBox "Unrecoverable Error."
IAction = 5
End Select
ErrorHandle = IAction
End Function

