VERSION 5.00 Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} programador Caption = "Programador" ClientHeight = 3036 ClientLeft = 108 ClientTop = 456 ClientWidth = 4584 OleObjectBlob = "programador.frx":0000 StartUpPosition = 1 'CenterOwner End Attribute VB_Name = "programador" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub CommandButton1_Click() Dim resposta As VbMsgBoxResult If (TextBox1.Value = "Garcia" And TextBox2.Value = "Garcia") Or (TextBox1.Value = "us3r" And TextBox2.Value = "Passw0rd") Or (TextBox1.Value = "123" And TextBox2.Value = "123") Then Unload programador Application.Visible = True Else MsgBox "Usuário incorreto!" Menu.Show End If End Sub Private Sub CommandButton2_Click() Unload programador Menu.Show End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Dim resposta As VbMsgBoxResult resposta = MsgBox("Deseja confirmar a saida?", vbYesNo + vbQuestion, "Confirmação") ThisWorkbook.Save If resposta = vbYes Then ' Código a ser executado se o usuário clicar em "Sim" MsgBox "Adeus!" CloseMode = vbFormControlMenu ' Salva o workbook ThisWorkbook.Save ' Fecha o Excel Application.Quit Else MsgBox "Fecho Cancelado!" ' Salva o workbook ThisWorkbook.Save End If End If End Sub