View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kevin Kevin is offline
external usenet poster
 
Posts: 134
Default Quiting Gracefully!

How do I prevent someone from closing a workbook unless
changes have been saved. I want to force the user to save
a file and not allow them to exit unless the changes have
been saved.

I have an Excel Workbook that the user will open as a
template. They will enter date, then save the information
and quit. I am using forms to control the users interface
but if they close the form, they can click the X at the
top (or select Quit from the Menu) and exit, then click
cancel on the SaveAs dialog box and quit the application
without saving changes.

I use a Form to allow the user to enter a file name, then
place the file in a specified directory. This all works
fine, but if they simply close the form and then hit the X
at the top, they can quit the application without saving
changes. If I can force them to go back to the form where
they enter a file name, that would be prefered because I
can then place the file in a directory of my choosing.

Any ideas or help would be appreciated.

Kevin