X
XP
Using Windows 2003 and Office XP;
I have the following in ThisWorkbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = True
Application.EnableEvents = False
Application.DisplayAlerts = False
ThisWorkbook.Close SaveChanges:=False
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub
I know that the alerts and the events are not likely switched back on since
they come after the close; however, this file is set to open "Read Only" by
default (file attribute) and I cannot get this thing to close without a "Do
you want to save" message. I want the file to drop dead on close: i.e. no
warnings, no questions asked, no save.
How can I get this to work?
Thanks much in advance for your assistance.
I have the following in ThisWorkbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = True
Application.EnableEvents = False
Application.DisplayAlerts = False
ThisWorkbook.Close SaveChanges:=False
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub
I know that the alerts and the events are not likely switched back on since
they come after the close; however, this file is set to open "Read Only" by
default (file attribute) and I cannot get this thing to close without a "Do
you want to save" message. I want the file to drop dead on close: i.e. no
warnings, no questions asked, no save.
How can I get this to work?
Thanks much in advance for your assistance.