View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ben McClave Ben McClave is offline
external usenet poster
 
Posts: 173
Default Using the OnTimer event to lock out users between specific time window.

Mick,

I'm not sure if it would work in your environment, but perhaps the Environ function would help. First, add this function to your workbook:

Function AllowAccess(sUser As String) As Boolean

Select Case sUser
Case "ajones", "jsmith" 'Customize list as needed
AllowAccess = True
Case Else
AllowAccess = False
End Select

End Function

Then, use this line to run the function:

AllowAccess (Environ("username"))

If the user's username is on the list, the function will return TRUE.

Good Luck,

Ben