新建From1(窗体),代码:
Private Sub Form_Load() On Error GoTo hErr MsgBox 1 / 0 Exit Sub hErr: Debug.Print Err.Source & " " & Err.Number & " " & Err.Description End Sub
得到结果:
工程1 11 除数为零