برای بستن باید پسورد بدین
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim pword As String
pword = InputBox("Please enter the password", "Password Required")
If pword <> "123" Then
If myFlg = True Then Exit Sub
Application.DisplayAlerts = False
Cancel = True
Else
MsgBox "proceed"
End If
End Sub




کامنت