View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Close file without saving

Hi,
I'm having problems with this one. I am entering your second code in "this
workbook" after other code. The application display alerts is still showing
the "do you want to save" screen and I'm getting an error message when I put
in - this workbook. close savechanges: = false
Any ideaqs ?
Mike

"Jarek" wrote:


Hi,

Private Sub Auto_Close()
ThisWorkbook.Saved = True 'does not save the workbook, only marks it
as saved
ThisWorkbook.Close False
End Sub

or

Private Sub Auto_Close()
Application.DisplayAlerts = False 'to eliminate prompt "Do you want
to save?"
ThisWorkbook.Close SaveChanges:=False
End Sub


Jarek


--
Jarek
------------------------------------------------------------------------
Jarek's Profile: http://www.excelforum.com/member.php...nfo&userid=965
View this thread: http://www.excelforum.com/showthread...hreadid=319815