View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default 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.