sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
I'm popping an error when I hit the "X" closing a userform. Here's the code that should close it. Am I missing something obvious?
thanks!
thanks!
Code:
Private Sub Userform_QueryClose(cancel As Integer, closemode As Integer)On Error GoTo Helper
If closemode = 0 Then
'Application Closer
If Workbooks.Count > 1 Then
ActiveWorkbook.Close
Else: Application.Quit
End If
End If
'Error Clearing Code
Exit Sub
Helper:
resp = MsgBox("We're sorry to see you've encountered an error." & vbCrLf & vbCrLf & "To proceed, we recommend you contact the Developer " & _
"with error codes [1026] and " & "[" & Err.Number & "-" & Err.Description & "]." & vbCrLf & vbCrLf & "To attempt to patch your problem at least " & _
"temporarily, we recommend you click [Yes] to see help directions. Would you like to continue?", vbYesNoCancel, name)
If resp = vbYes Then
Call Error_Handle(sProcName, Err.Number, Err.Description)
ElseIf resp = vbNo Then
Exit Sub
ElseIf resp = vbCancel Then
Exit Sub
End If
End Sub