W
wayne
The following code has been copied from an Excel workbook
and the text "workbook" has been changed
to "ThisDocument".
When in excel and the workbook is opened it checks the
user name. If your on the list excel starts as normal if
not your out.
I've place this code in the code module for ThisDocument
but can't get the code to work.
Any ideas?
Dim User
Private Sub ThisDocument_Open()
User = Application.UserName
Application.DisplayAlerts = False
If (User = "Name1") Or (User = "Name2") Or (User
= "Name3") Then Beep Else Application.Quit
Application.DisplayAlerts = True
End Sub
and the text "workbook" has been changed
to "ThisDocument".
When in excel and the workbook is opened it checks the
user name. If your on the list excel starts as normal if
not your out.
I've place this code in the code module for ThisDocument
but can't get the code to work.
Any ideas?
Dim User
Private Sub ThisDocument_Open()
User = Application.UserName
Application.DisplayAlerts = False
If (User = "Name1") Or (User = "Name2") Or (User
= "Name3") Then Beep Else Application.Quit
Application.DisplayAlerts = True
End Sub