Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default restricting access using a macro

hi there,
Does anybody know of a method for restricting access to a workbook based on
a list of people.
My problem is I have a workbook that two groups of people need to access 1
group as read only the other with red/write access.
I know I can use the password method but some of the read/write group are
moaning about having to enter a password every time.
So I was just wondering if there was a way of comparing the username of the
person who opens the workbook to a list within that workbook & allowing write
access if they match.
Cheers
Popeye

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default restricting access using a macro

You could get the user name by using the envirn command

User = Environ("UserName")

You would have to make the VBA Project protected, but you could have a
workbook open macro that gets the user name and then unprotects the sheet in
VBA code. Then you would need a workbook close event to automatically
protected the sheets. I would also in the workbook open macro that if the
username did not have write protection to protect the sheets just in case the
workbook got closed without being protected.

You could also could use the XP or Vista protectection on the file.

"Popeye the powerman" wrote:

hi there,
Does anybody know of a method for restricting access to a workbook based on
a list of people.
My problem is I have a workbook that two groups of people need to access 1
group as read only the other with red/write access.
I know I can use the password method but some of the read/write group are
moaning about having to enter a password every time.
So I was just wondering if there was a way of comparing the username of the
person who opens the workbook to a list within that workbook & allowing write
access if they match.
Cheers
Popeye

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default restricting access using a macro

Hi,

You don't need to use a macro. Choose Tools, Protection, Allow Users to
Edit Ranges. Click New, delete the contents of the Refers to cells box and
click the top left corner of the spreadsheet (the intersection of the row
numbers and column letters). Add a password and click OK, confirm the
password and click OK. Click Protect Sheet enter the same password (or
another), confirm it and hit OK. With this approach anyone can open the
workbook but when they try to do any editing they will be prompted for a
password. You need to do this for each sheet you want protected.

Alternatively you can choose the command Tools, Options, Security, and enter
and confirm a Password to modify, in the File sharing settings for this
workbook area. Again, any user can open the file but they will be prompted
when they do for a password to modify or they can choose read only. In this
case you don't need to do it for each sheet. Depending on exactly what you
need this may be the better choice.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Popeye the powerman" wrote:

hi there,
Does anybody know of a method for restricting access to a workbook based on
a list of people.
My problem is I have a workbook that two groups of people need to access 1
group as read only the other with red/write access.
I know I can use the password method but some of the read/write group are
moaning about having to enter a password every time.
So I was just wondering if there was a way of comparing the username of the
person who opens the workbook to a list within that workbook & allowing write
access if they match.
Cheers
Popeye

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default restricting access using a macro

Shane: Read the original posting. The users DON'T want to type a password.

"Shane Devenshire" wrote:

Hi,

You don't need to use a macro. Choose Tools, Protection, Allow Users to
Edit Ranges. Click New, delete the contents of the Refers to cells box and
click the top left corner of the spreadsheet (the intersection of the row
numbers and column letters). Add a password and click OK, confirm the
password and click OK. Click Protect Sheet enter the same password (or
another), confirm it and hit OK. With this approach anyone can open the
workbook but when they try to do any editing they will be prompted for a
password. You need to do this for each sheet you want protected.

Alternatively you can choose the command Tools, Options, Security, and enter
and confirm a Password to modify, in the File sharing settings for this
workbook area. Again, any user can open the file but they will be prompted
when they do for a password to modify or they can choose read only. In this
case you don't need to do it for each sheet. Depending on exactly what you
need this may be the better choice.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Popeye the powerman" wrote:

hi there,
Does anybody know of a method for restricting access to a workbook based on
a list of people.
My problem is I have a workbook that two groups of people need to access 1
group as read only the other with red/write access.
I know I can use the password method but some of the read/write group are
moaning about having to enter a password every time.
So I was just wondering if there was a way of comparing the username of the
person who opens the workbook to a list within that workbook & allowing write
access if they match.
Cheers
Popeye

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
Sharing a Workbook But Restricting Access to Certain Sheets Brandy Excel Discussion (Misc queries) 4 June 16th 08 07:58 PM
Restricting Access to Parts of worksheet confused from Ireland Excel Worksheet Functions 1 October 16th 07 12:53 AM
Restricting access to a range of cells anandmr65 Excel Discussion (Misc queries) 1 July 26th 06 12:49 PM
restricting access to a worksheet? C.East Excel Discussion (Misc queries) 2 April 5th 06 10:02 PM
Restricting Multi-user access [email protected] Excel Worksheet Functions 0 June 17th 05 03:03 PM


All times are GMT +1. The time now is 06:18 AM.

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

About Us

"It's about Microsoft Excel"