Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Logon to Worksheet

Michael,

Does everyone have their own copy of Excel on their PC's??
i.e. Do they each have unique Usernames??
You can check by going into Tools/Options/General

If they do, an easy way would be to just check the
Application.Username against a list and if on the list
allow them to open the file.

Post back with more info and I'll try to supply you with some
code based on your situation.

John

Michael wrote:

Hi Guys, Is it possible to create a log-on input box with
excel that will search a column of names before it will
allow access to a worksheet, maybe with a auto_open macro.

I am trying to avoid passwork protection and I only allow
certain members of staff access file, with giving
everybody a password.

Thanks for your help

Michael


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Logon to Worksheet

Michael,

as I would really like them create the impression of security.

Just keep in mind that it is only an "impression". To an experienced
user, any kind of protection scheme that can be devised is merely
a minor annoyance.

Anyway....
Here's what I do on one of my workbooks.
There are other ways.
Set up a one column range on a separate sheet and name the range
"Auth_List". In that range, place the Usernames (or serials as you have
them).

Ina regular module:

Sub RestrictCheck()
Dim Auth As Range ' Set memvar "Auth" as a range
Set Auth = Range("AuthList") 'Set "Auth" to the "AuthList" range
On Error GoTo ErrorHandler ' Error trap in case name isn't in
AuthList
Dim IsOnList As String ' memvar necessary for next function
' Check to see if this UserName matches a UserName in the AuthList
IsOnList = Application.WorksheetFunction. _
VLookup(Application.UserName, Auth, 1, False)
' The above line will cause an error if a match is not found.
' Insure that error trapping is on, so that the error can be
generated
On Error GoTo 0 ' Reset error trapping
' User found on list. Do nothing
Exit Sub
ErrorHandler:
If Left(Err.Description, 9) = "Unable to" Then
'User not on list
End If
End Sub

In the above, in place of 'User not on List you can use
ThisWorkbook.Saved = True
ThisWorrkbook.Close.

To make this work when the workbook opens, call this sub from
the Workbook_Open Event or from a sub named Auto_Open

Example:

Sub Auto_Open()
RestrictCheck
End Sub

John

Michael wrote:

Hi John,

Yes they do have own copies. The username however is a
serial no. instead of an actual name as we use this for
logging PC's. So I was thinking maybe VLOOKUP table may
work with code ?, as I would really like them create the
impression of security.

Michael

-----Original Message-----
Michael,

Does everyone have their own copy of Excel on their PC's??
i.e. Do they each have unique Usernames??
You can check by going into Tools/Options/General

If they do, an easy way would be to just check the
Application.Username against a list and if on the list
allow them to open the file.

Post back with more info and I'll try to supply you with

some
code based on your situation.

John

Michael wrote:

Hi Guys, Is it possible to create a log-on input box

with
excel that will search a column of names before it will
allow access to a worksheet, maybe with a auto_open

macro.

I am trying to avoid passwork protection and I only

allow
certain members of staff access file, with giving
everybody a password.

Thanks for your help

Michael


.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to logon to brokerage account aligatrjoe Excel Discussion (Misc queries) 3 January 14th 08 07:47 PM
Logon Elindeo New Users to Excel 1 October 28th 07 12:44 PM
logon rww Excel Discussion (Misc queries) 0 November 18th 06 04:42 AM
Logon Screen mamun316 Excel Worksheet Functions 1 November 7th 05 07:27 PM
How do I populate a cell with the NT Logon username? Mike Excel Discussion (Misc queries) 1 June 3rd 05 07:58 AM


All times are GMT +1. The time now is 12:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"