I have a module in my workbook that builds a new xlsx workfile from data read in other files.
After building the workfile, the module displays a userform with a button (modeless so the user can update the data in the new workfile).
When the user is through updating the workfile, I want to force them to click the button on the userform to save & close the workfile.
I do not want to allow the user to close the workfile by clicking on the X on the workfile.
How can I associate a beforeclose method to the new workfile, to prevent the usage of the X to close the workfile?
Also, when the userform button is pressed, the workfile should save & close.
After building the workfile, the module displays a userform with a button (modeless so the user can update the data in the new workfile).
When the user is through updating the workfile, I want to force them to click the button on the userform to save & close the workfile.
I do not want to allow the user to close the workfile by clicking on the X on the workfile.
How can I associate a beforeclose method to the new workfile, to prevent the usage of the X to close the workfile?
Also, when the userform button is pressed, the workfile should save & close.