PDA

View Full Version : Solved: Disable "X" button



gsouza
01-27-2006, 05:17 AM
Hi everybody :hi:
Is it possible to disable the "x" button in a workbook but then have it enabled after 3:00 pm. I don't want the user to be able to close the workbook before 3:00 pm. If anybody can help I would greatly appreciate it as always.

XLGibbs
01-27-2006, 05:37 AM
There are multiple options...



Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Format(Now(), "h:mm") < "15:00" Then
Cancel = True
Exit Sub
End If

End Sub


Hope that helps..there are other options for setting flags if you need particular events to happen before closing...

gsouza
01-27-2006, 05:41 AM
That was so easy, I should have been able to figure that out. Maybe I need more coffee. Thank you :banghead: