Is this code ok?

  • Thread starter Thread starter ADK
  • Start date Start date
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
 
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)
 
I don't like other workbooks that try to close excel. What if I have multiple
workbooks open when I close your workbook?
 
Back
Top