View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Programatically close a file without saving

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

Gord Dibben Excel MVP

On 25 Dec 2004 15:23:16 -0800, wrote:

Hello:
I need to be able to close a file programmatically, but when I try to
do so the Excel message: "Do you want to save the changes that you made
to ---" With the choices "Yes", "No" and "Cancel" comes off & I would
like to close the file without saving it.
I would appreciate help wit the above.

TIA
Vinay