Private Sub Form_Unload (Cancel as Integer) If MsgBox("¿Quieres salir?",VbQuestion+VbYesNo,"¿Salir?") = VbYes then Unload Me Else Cancel = true End If End Sub