disable save as dialog box

G

Guest

I have a workbook where I disabled all menu items, and the only way to exit
is by choosing the "x" in the upper right corner. I have some code to
disable the "save as" dialog box, that I think used to work, but for some
reason, now does not. In the "This Workbook" object I have:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Workbooks("Urizen.xls").Saved = True
End Sub

I tried adding application.displayalerts=false and this did not work either.

What am I missing?
 
J

Jim Cone

Events must be enabled for your code to work.

Run this and see if things get better ...

Sub FixThings
Application.EnableEvents = True
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Dion" <[email protected]>
wrote in message
I have a workbook where I disabled all menu items, and the only way to exit
is by choosing the "x" in the upper right corner. I have some code to
disable the "save as" dialog box, that I think used to work, but for some
reason, now does not. In the "This Workbook" object I have:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Workbooks("Urizen.xls").Saved = True
End Sub

I tried adding application.displayalerts=false and this did not work either.
What am I missing?
 
G

Guest

You could also insert this procedure:
Sub Auto_Close()
ThisWorkbook.Save
ThisWorkbook.Close
End Sub
 

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