Exit without saving


Posted by Jason on September 27, 2001 11:39 AM

I have created a program in Excel for managers that lets them e-mail their employees time off directly to me. However, when they exit Excel, it ask them to save their changes which I do not want them to do. Is there a way to write a macro that tells Excel to exit without saving any changes. Thanks

Posted by Mark O'Brien on September 27, 2001 11:53 AM

Insert this code onto the workbook object

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Me.Saved = False Then Me.Saved = True
End Sub

that should work.



Posted by Jason on September 27, 2001 12:22 PM

Cool. Thanks