how do i enable user logins
Excel security is easily defeated at the best of time so anything you do can
be defeated if your end users are motivated to do so. That being said, my
preference is to create a list of allowed users on a hidden sheet within the
book. I then use the Workbook_Open event to check the users login name
against the list of allowed names. Something like this...
Private Sub Workbook_Open()
Dim rng As Range
Set rng = Sheets("Sheet1").Cells.Find(What:=Environ.UserName , _
LookAt:=xlWhole, _
MatchCase:=False)
If rng Is Nothing Then
MsgBox "The name was not found. Time to close the book."
ThisWorkbook.Close False
End If
End Sub
Note that it is looking for your windows login name... I like this method
because it is easy and you do not have to remember passwords and such. If you
want a password solution then I would recommend taking the excel file and
doing a save as and then using Tools - General Options to attach a password
(which is actually very good protection).
--
HTH...
Jim Thomlinson
"slacky75" wrote:
I'm trying to create an excel template that will require users login inorder
to use the spread sheet. How would I go about doing that? Any help will be
great. Thanks
|