Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi all, I need to restrict access to a workbook based on the user name of the person opening the workbook. I don't want to use passwords and protection as I don't need that file to be all that secure. So I've got the following macro to change the status of the sheet based on the user name. This seems to work but it is possible to change the user name in Tools\Options and reopen the sheet with write access. Private Sub workbook_open() Select Case Application.UserName Case Is = "Pippa" End Case Else ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly End Select End Sub Any better suggestions? Thanks in advance -- skuzapo ------------------------------------------------------------------------ skuzapo's Profile: http://www.excelforum.com/member.php...o&userid=27430 View this thread: http://www.excelforum.com/showthread...hreadid=475174 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You wouldn't bother using a login for the file if you didn't want it somewhat
secure. So you could... In the file select saveAs, then in the tools dropdown open up 'General Options' Use a password to open and a separate to modify. Those with access to open can open and those with the password to modify can modify. Make sure you also check the read only recommended button. JNW "skuzapo" wrote: Hi all, I need to restrict access to a workbook based on the user name of the person opening the workbook. I don't want to use passwords and protection as I don't need that file to be all that secure. So I've got the following macro to change the status of the sheet based on the user name. This seems to work but it is possible to change the user name in Tools\Options and reopen the sheet with write access. Private Sub workbook_open() Select Case Application.UserName Case Is = "Pippa" End Case Else ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly End Select End Sub Any better suggestions? Thanks in advance -- skuzapo ------------------------------------------------------------------------ skuzapo's Profile: http://www.excelforum.com/member.php...o&userid=27430 View this thread: http://www.excelforum.com/showthread...hreadid=475174 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Spreadsheet defaults to Read Only for ONE user... | Excel Discussion (Misc queries) | |||
Spreadsheet defaults to read-only for ONE user only?? | Excel Discussion (Misc queries) | |||
Set as read only based on user name. | Excel Programming | |||
New user help and Excel read question (Interop and OleDb) | Excel Programming | |||
Can I set up a worksheet as read only for one user | Excel Programming |