VBA异常后弹框提示

Sub test3()
   
    Dim i As Integer
    Dim n As Integer 

    On Error GoTo error_test3

    i = 1   

    n = i / 0


    Exit Sub
    
error_test3:

    MsgBox "程序错误,请联系开发人员!", vbSystemModal

End Sub

你可能感兴趣的:(VB/VBA)