I have developed a user form in excel, and I want to determine the best way to make sure that the data is saved if the close button is hit. Currently, I have a save procedure in the UserForm_QueryClose event and also in the UserForm_Deactivate event. I am thinking that I should put the same procedure in the Workbook_BeforeClose event. Would the form events occur before the workbook events?
Public Function returnsDataEntryFormLoaded
returnsDataEntryFormLoaded
End Function
Private Sub Workbook_BeforeClose(Cance
Dim fDataEntryLoaded As Boolean
fDataEntryLoaded = basFunctions.returnsDataEn
Select Case fDataEntryLoaded
Case True
Cancel = True
Exit Sub
Case False
End Select
End Sub
Private Sub UserForm_QueryClose(Cancel
'Occurs before a userform is closed or unloaded.
Call basProcedures.executeSaveF
Call basProcedures.executeSaveW
Call basProcedures.executeSaveA
End Sub