![]() |
How to Save this?
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
MsgBox "Cannot Save this Workbook...Closing Excel!!!" Application.DisplayAlerts = False ActiveWorkbook.Close Application.DisplayAlerts = True Application.Quit End Sub -- Ak |
How to Save this?
You could go to the immediate window and type
APplication.EnableEvents = False and save it. Then turn the events back on if you need them. -- HTH, Barb Reinhardt "Ak Man" wrote: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "Cannot Save this Workbook...Closing Excel!!!" Application.DisplayAlerts = False ActiveWorkbook.Close Application.DisplayAlerts = True Application.Quit End Sub -- Ak |
How to Save this?
Perfect!!!
Thanks....I was thinking about using enable events but just couldn't figure out how..... -- Ak "Barb Reinhardt" wrote: You could go to the immediate window and type APplication.EnableEvents = False and save it. Then turn the events back on if you need them. -- HTH, Barb Reinhardt "Ak Man" wrote: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "Cannot Save this Workbook...Closing Excel!!!" Application.DisplayAlerts = False ActiveWorkbook.Close Application.DisplayAlerts = True Application.Quit End Sub -- Ak |
All times are GMT +1. The time now is 07:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com