Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
    On Error GoTo StopClose
    If IsScheduled Then 예약취소
    If IsScheduled Then
        Cancel = True
        MsgBox "예약 취소를 확인하지 못해 닫기를 중단했습니다."
    End If
    Exit Sub
StopClose:
    Cancel = True
    MsgBox "예약 상태 확인 중 오류가 발생해 닫기를 중단했습니다."
End Sub