Private Sub Workbook_BeforeSave...
MsgBox "Why"
If Form1 is focused – the MsgBox doesn’t appear. Saving procedure is canceled.
Plese don’t tell me that the end user must click outside the form to save the file.
Form1 is not modal.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In such a case simply paste this code in your userform. This code is slightly modified from my other answer.
CODE (Tried And Tested):
SCREENSHOT:
NOTE: This is not a foolproof method as a user may press CTRL and then types something else and then presses the “S” key then the code will still fire. We can include a small check to see if the next key pressed after CTRL was pressed is S or not. If not then set it to false again… For example