PDA

View Full Version : Password protect and unprotect a worksheet/workbook



tomski
12-10-2018, 03:22 AM
Hi,

I'm struggling with the following:

I have a workbook with different worksheets containing people's working hours and working schedules.

There are two sheets that are allways visible: Agenda and Tasks

These sheets should be allways visible for every user, but they should only be read-only, except for the administrator of the file.

Then there are five more sheets, one per employee containing the working hours of that employee. The emloyee who logs in should only be able to see the sheets Agenda, Tasks and his individual sheet, all in read only modus.

The administrator that logs in should be able to see everything and needs write access to all sheets.

I don't know how to accomplish this, I even don't know if it's possible at all…


What I've got till now:

* Employees can log in to the workbook and can see 3 sheets, but they have write access and thats not as it should be.
* The Administrator can't login :-)

Can anyone help me out?


Thanks!
Tommy

Paul_Hossler
12-10-2018, 12:13 PM
How do you tell who is the Admin and which employee is accessing the workbook?

tomski
12-11-2018, 01:02 AM
Hi Paul , I use a login form for that.

Paul_Hossler
12-11-2018, 08:11 AM
Hi Paul , I use a login form for that.

I meant what parameters can the macro use to determine who is running the macro

It sounds like the person's identification is a UF TextBox with some sort of name or ID?

Many times people will use the ENVIRON("USERNAME")

大灰狼1976
12-12-2018, 12:46 AM
Hi tomski!
This may be a little inspiring to you.
Please refer to the attached.

大灰狼1976
12-13-2018, 12:09 AM
I have revised a little, then if someone close the login form directly, The workbook will be automatically closed.