Oke...Thanx for the help... =)
here is the file =
Quit Problem.xlsm
my current case is that i want excel to prompt a password when we hit the "X" (close) button..
and instead of quitting by X button, we can use a macro button (named "Quit")
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim exitpass As String
exitpass = InputBox("Enter exit password:")
If exitpass = "123" Then
Application.Quit
Else
MsgBox "can't close now !!"
Cancel = True
End If
End Sub
Sub Button1_Click()
Application.Quit
End Sub
the problem is that the second macro will trigger the first macro, then pop up password prompt window....
i was thinking about a syntax that can automatically input the value into the input box, so that i can write it after "Application.Quit"
is there any ?
or any other idea on this problem ?
Thanx so much =)
Bookmarks