View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Living the Dream Living the Dream is offline
external usenet poster
 
Posts: 151
Default Using the OnTimer event to lock out users between specific time window.

Hi guy's

Seems this may not be possible as yet no takers..

I was thinking along the lines of this, but unfortunately it does not
work, maybe someone could help steer me in the right direction
please..

Private Sub Workbook_Open()

Dim OpenTime As String
Dim resp As Long

OpenTime = Format(Now, "h:mm:ss AM/PM")

If OpenTime < #4:01:00 PM# #2:29:00 PM# Then

resp = MsgBox("YOU ARE NOT ALLOWED ACCESS BETWEEN 2.30 & 4.00PM
DAILY - PLEASE TRY LATER", vbOKOnly)
ThisWorkbook.Close SaveChanges:=False

End If

End Sub


It would so cool if Excel had the same BeforeOpen() function as does
Access...

In the event anybody happens to have a work-around for the above, I
will then need a way using VB to bypass the above so the main user who
requires unfetted access between the above times can access it.

Guy's

If this is pie-in-the-sky and not possible, please let me know and I
will stop wasting time on it and look for another alterative.

Appreciate any assistance or comments.

TIA
Mick.