/ Published in: Visual Basic
Expand |
Embed | Plain Text
'------------------------------------------------------------------------------- ' Let the user know we're all done. '------------------------------------------------------------------------------- MsgBox "Recruitment data import complete" '=============================================================================== ' Error Handling, object variable destruction and reset settings. '=============================================================================== TidyUp: On Error Resume Next ' So we don't end up in an error loop '------------------------------------------------------------------------------- ' Destroy any object variables. '------------------------------------------------------------------------------- ' Set objSheet = Nothing '------------------------------------------------------------------------------- ' Reset screen updating, alerts and the status bar. '------------------------------------------------------------------------------- Application.ScreenUpdating = True Application.DisplayAlerts = True Application.StatusBar = False Application.Calculation = xlCalculationAutomatic Exit Sub ErrHandler: Select Case Err.Number Case 1004 If InStr(1, UCase(Err.Description), "SHOWALLDATA") Then Resume Next Else MsgBox "Error in Subroutine " & cStrSub & ", Module " & _ cStrModule & "." & vbCrLf & "Error Number: " & _ Err.Number & vbCrLf & "Description: " & Err.Description, _ vbOKOnly + vbCritical, "Error Occurred" End If Case Else MsgBox "Error in Subroutine " & cStrSub & ", Module " & _ cStrModule & "." & vbCrLf & "Error Number: " & _ Err.Number & vbCrLf & "Description: " & Err.Description, _ vbOKOnly + vbCritical, "Error Occurred" End Select Resume TidyUp Resume ' For use while debugging
You need to login to post a comment.
