-
Solved: Closing an Excel Workbook without "Save" Prompt
I have been trying to write some VB code for disabling the "Save Changes" prompt when closing a workbook. I followed the instructions for writing an Auto_Close macro (from microsoft tech site), but it doesn't seem to work. It keeps on asking if I want to save changes. Am I misunderstanding something? Isn't this macro supposed to run "automatically" when the user closes the file? I'm working in Excel 2000. Thanks.
-
Hi J,
Welcome to the forum.
I'd recommend that you adopt the 'new' events rather than the 'old' Auto procedures. Right-click on the Excel icon to the left of the File menu in Excel and select View Code - this will take you to the ThisWorkbook object.
In the ThisWorkbook code pane insert the following:
[vba]Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Saved = True
End Sub[/vba]That should do what you want.
-
Richie:
Worked like a charm. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules