#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Passwords

I know how to protect certain cells so that different users can only access
what they are allowed, and I know how to password protect a sheet. How can I
combine the two so that when you use a password to open a workbook, it only
gives you access to what you are allowed.

Thanks ahead of time,
Chris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Passwords

Get the environmental variable for the username usingg this code

User = Environ("UserName")

then you can have a list of users that the macro will automatically unprotect

"Still Learning" wrote:

I know how to protect certain cells so that different users can only access
what they are allowed, and I know how to password protect a sheet. How can I
combine the two so that when you use a password to open a workbook, it only
gives you access to what you are allowed.

Thanks ahead of time,
Chris

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Passwords

Will that make it so when Joe logs in, he only has access to a1, Steve can
access b1 and Mary can access c1?

"Joel" wrote:

Get the environmental variable for the username usingg this code

User = Environ("UserName")

then you can have a list of users that the macro will automatically unprotect

"Still Learning" wrote:

I know how to protect certain cells so that different users can only access
what they are allowed, and I know how to password protect a sheet. How can I
combine the two so that when you use a password to open a workbook, it only
gives you access to what you are allowed.

Thanks ahead of time,
Chris

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Passwords

Put this code into a workbook open event

User = Environ("UserName")
select case User
Case "Joe"
'add code to unprotect a1
Case "Mary"
'add code to unprotect b1
Case "Steve"
'add code to unprotect c1
end select

"Still Learning" wrote:

Will that make it so when Joe logs in, he only has access to a1, Steve can
access b1 and Mary can access c1?

"Joel" wrote:

Get the environmental variable for the username usingg this code

User = Environ("UserName")

then you can have a list of users that the macro will automatically unprotect

"Still Learning" wrote:

I know how to protect certain cells so that different users can only access
what they are allowed, and I know how to password protect a sheet. How can I
combine the two so that when you use a password to open a workbook, it only
gives you access to what you are allowed.

Thanks ahead of time,
Chris

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Passwords

I guess I didn't explain this very well, let me try again.

If someone opens a protected workbook with a password, how do I give them
different access based on which password they enter? If they open
"schedule.xls" and it asks them for a password, if they type "joe" as a
password, they get to enter data in a1. "steve" would allow them b1...

Hopefully this clears this up.

Thanks,
Chris


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Passwords

I would have a hidden worksheet with usernames in column A and Pasword in
column B and access range for each user in columns C, column D column E, ...

then you can have an input boxes where the usere type in his name and
password. then you can use a lookup to verify the user and pasword and then
unlock the ranges specified in column C+.

"Still Learning" wrote:

I guess I didn't explain this very well, let me try again.

If someone opens a protected workbook with a password, how do I give them
different access based on which password they enter? If they open
"schedule.xls" and it asks them for a password, if they type "joe" as a
password, they get to enter data in a1. "steve" would allow them b1...

Hopefully this clears this up.

Thanks,
Chris

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
add-in passwords Richard Edwards[_2_] Excel Programming 6 February 24th 09 03:22 PM
Passwords ranswrt Excel Programming 3 July 14th 08 09:32 PM
Passwords Lillian[_2_] Excel Discussion (Misc queries) 6 July 30th 07 01:32 PM
Add-ins passwords bad_boyu Excel Programming 1 June 11th 06 06:58 AM
Passwords dhightow Excel Discussion (Misc queries) 0 April 24th 06 08:22 PM


All times are GMT +1. The time now is 12:31 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"