Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Posted in another news group but no response.
I have a situation where I have 7 workbooks open at any given time. I have created macros that saves, backups all workbooks and then Quits Excel when exiting using a command button. I have found that the users are sometimes X'ing out of excel and not saving the changes. I therefore added the following to the Thisworkbook module. What happens now is if the user X's out it will save however, if they use the command button it saves the workbooks two times. But it never closes the workbooks or Quits Excel. Is there another way to get around this dilemma? Private Sub Workbook_BeforeClose(Cancel As Boolean) If ThisWorkbook.Saved = True Then MsgBox "Saved Will Close" Else MsgBox "Not Saved Will Save" Application.DisplayAlerts = False ThisWorkbook.Save Application.DisplayAlerts = True End If End Sub -- Thank You in Advance Ed Davis |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbook_BeforeClose(Cancel As Boolean) - Cancel won't work | Setting up and Configuration of Excel | |||
Workbook_BeforeClose Question | Excel Worksheet Functions |