Is this code ok?

A

ADK

Before I implement this in my workbook, I just wanted to know if anyone sees
issues/problems with using this code. Seems to work fine. If ok, should I
include error handling in the code?

Both are in ThisWorkbook

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFullScreen = False
Application.Quit
End Sub

Private Sub Workbook_Open()
Application.DisplayFullScreen = True
End Sub

Thanks,

ADK
VBA Beginner
 
B

Bob Phillips

Looks okay, but what happens if the workbook has changed, you will get a
message asking to save. Is that OK< or do you want to handle automatically?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
D

Dave Peterson

I don't like other workbooks that try to close excel. What if I have multiple
workbooks open when I close your workbook?
 

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