Is it possible to force a user to save on exit. I added a button to run save and exit but they are still closing with the x.
Is it possible to force a user to save on exit. I added a button to run save and exit but they are still closing with the x.
Last edited by Rodeoclown; 05-20-2010 at 07:44 AM.
Posted in wrong thread
Last edited by Rodeoclown; 05-20-2010 at 07:32 AM. Reason: Posted in wrong thread
Why not just make the sheet save itself if/when the user hit's the "X"?
Place the following code in "ThisWorkbook" (right-click on any sheet, select "view code", click on 'ThisWorkbook'
![]()
Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.EnableEvents = False ActiveWorkbook.Save Application.EnableEvents = True End Sub
_______________________________________________
Remember:
Read the rules!
Use code tags! Place [CODE] before the first line of code and [/CODE] after the last line of code.
Mark your post [SOLVED] if it has been answered satisfactorily.
To do this, click EDIT in your original post, click GO ADVANCED and set the PREFIX. It helps everybody!
If you are approve (or disapprove) of any members response to your problem, please click theicon underneath their post and comment. It matters.
That will work. Thanks
That will work. Thanks
What does "Application.EnableEvents = True/false" in this accomplish?
gsweeney5150,
Please do not resurrect old threads. Further, do not post your question in the thread someone else has started - this is known as thread hijacking and is against the Forum Rules.
Always start your own thread and, if it helps to clarify your needs, provide a link back to other threads.
I suggest you take the time to read the Forum Rules so that you can avoid infractions that will impact your posting privileges.
Ben Van Johnson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks