View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 788
Default Close file without saving

hi.i'm only starting to learn this, but try calling the next macro before the
end of your first macro...

like before "end sub", type "call (your macro name)"

learned it from joel... thanks joel

"Mike" wrote:

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