BeforeSave and Userform: Issues with saving the excel file
Hi! I am trying to capture and save comments when the user tries to save the excel through a BeforeSave function and user form. The code works fine but it saves the excel even if user cancels the userform. Here are the codes:
The BeforeSave code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Comments_form.Show
If Comments_form.Cancel = True Then Cancel = True
End Sub
The Userform code w.r.t. cancel click is:
Private Sub Cancel_Click()
Comments_form.Hide
End Sub