How to Save this?

A

Ak Man

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
 
B

Barb Reinhardt

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.
 
A

Ak Man

Perfect!!!
Thanks....I was thinking about using enable events but just couldn't figure
out how.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top