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

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False

End Sub

"Jeff Wright" wrote:

Hi,

I don't want users of my workbook to have the option of saving changes when
closing. I tried:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Application.DisplayAlerts = False
End Sub

.. . . but this doesn't work. How can I code my workbook to close with no
prompts to the user??

Thanks!!

Jeff