Changing Read Only/ Read write access depending on username

RossTrepleton

New Member
Joined
Jan 22, 2010
Messages
8
Hi,

i have an excel production planning tool on a network.
I want certain users (3) to be able to open the workbook and edit the data, whilst I want everyone else to be able to open the workbook.

I think this can be done using ChangeFileAccess but I am struggling.

Any ideas on what I need to do?

Thanks,

Ross
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Not tested, try:

<font face=Courier New><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Workbook_Open()<br>    <SPAN style="color:#00007F">If</SPAN> <SPAN style="color:#00007F">Not</SPAN> Environ("Username") = "SmithJ" _<br>    And <SPAN style="color:#00007F">Not</SPAN> Environ("Username") = "SmytheK" <SPAN style="color:#00007F">Then</SPAN><br>        ThisWorkbook.ChangeFileAccess (xlReadOnly)<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0
Sorry- I was too quick to say this was working!
Unfortunately since I have put this code in everytime I make a change to the workbook it crashes!

Any more ideas?

Thanks,

Ross
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,390
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top