![]() |
Save file dialog box in Excel
When working on a document I clicked on the x to close the worksheet and I
got the usual dialogue and instead of clicking yes to save it I accidentally selected no. I know this question is far-fetched but I thought I would ask it anyway. Is there any Excel options that can be set to prompt you again. Thanks. |
Save file dialog box in Excel
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean) Cancel = True Application.EnableEvents = False If MsgBox("Save the file", vbYesNo) = vbYes Then ThisWorkbook.Save Else If MsgBox("ARe you sure you don't want to save the file", vbYesNo) = vbNo Then ThisWorkbook.Save End If End If End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "falcios" wrote in message ... When working on a document I clicked on the x to close the worksheet and I got the usual dialogue and instead of clicking yes to save it I accidentally selected no. I know this question is far-fetched but I thought I would ask it anyway. Is there any Excel options that can be set to prompt you again. Thanks. |
Save file dialog box in Excel
Re-enable events?
-- Jim "Bob Phillips" wrote in message ... | Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As | Boolean) | Cancel = True | Application.EnableEvents = False | If MsgBox("Save the file", vbYesNo) = vbYes Then | ThisWorkbook.Save | Else | If MsgBox("ARe you sure you don't want to save the file", vbYesNo) = | vbNo Then | ThisWorkbook.Save | End If | End If | | End Sub | | 'This is workbook event code. | 'To input this code, right click on the Excel icon on the worksheet | '(or next to the File menu if you maximise your workbooks), | 'select View Code from the menu, and paste the code | | | -- | --- | HTH | | Bob | | (there's no email, no snail mail, but somewhere should be gmail in my addy) | | | | "falcios" wrote in message | ... | When working on a document I clicked on the x to close the worksheet and I | got the usual dialogue and instead of clicking yes to save it I | accidentally | selected no. | | I know this question is far-fetched but I thought I would ask it anyway. | Is | there any Excel options that can be set to prompt you again. | | Thanks. | | |
Save file dialog box in Excel
If you are asking if you can get your unsaved work back the answer is no.
Gord Dibben MS Excel MVP On Mon, 12 Feb 2007 02:46:01 -0800, falcios wrote: When working on a document I clicked on the x to close the worksheet and I got the usual dialogue and instead of clicking yes to save it I accidentally selected no. I know this question is far-fetched but I thought I would ask it anyway. Is there any Excel options that can be set to prompt you again. Thanks. |
Save file dialog box in Excel
Thank-you, it would be a good idea.
-- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Jim Rech" wrote in message ... Re-enable events? -- Jim "Bob Phillips" wrote in message ... | Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As | Boolean) | Cancel = True | Application.EnableEvents = False | If MsgBox("Save the file", vbYesNo) = vbYes Then | ThisWorkbook.Save | Else | If MsgBox("ARe you sure you don't want to save the file", vbYesNo) = | vbNo Then | ThisWorkbook.Save | End If | End If | | End Sub | | 'This is workbook event code. | 'To input this code, right click on the Excel icon on the worksheet | '(or next to the File menu if you maximise your workbooks), | 'select View Code from the menu, and paste the code | | | -- | --- | HTH | | Bob | | (there's no email, no snail mail, but somewhere should be gmail in my addy) | | | | "falcios" wrote in message | ... | When working on a document I clicked on the x to close the worksheet and I | got the usual dialogue and instead of clicking yes to save it I | accidentally | selected no. | | I know this question is far-fetched but I thought I would ask it anyway. | Is | there any Excel options that can be set to prompt you again. | | Thanks. | | |
All times are GMT +1. The time now is 04:04 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com