On opening a workbook (XL2003) I want users to enter a password
which will give them read Only permissions or access to the whole
I do not want use the "save as" option it is not suitable for my needs & here is why.
I have about 10 staff who need to fill in timesheets using XL SS on a public folder on the server. The staff need full access to file & management such as myself only need to view (read only) the timesheet without the ability to change data. Using the "save as" function the staff need to input 2 passwords.
The staff (in general) are not overly computer literate so I was hoping to be able to write code so that on Workbook_Open event only one password is entered and depending on the password gives the user full access or readonly access. This will also save management having to remember different passwords for read only access to different staff timesheet files & will give crude protection to the files.
Here is the code
Private Sub Workbook_Open() Dim Message, Title, Default, Password As String Message = "Enter your password" ' Set prompt. Title = "Password" ' Set title. Default = " " ' Set default. ' Display message, title, and default value. Password = InputBox(Message, Title, Default) If Password = "test" Then Workbook.ReadOnly = True Else Workbook.ReadOnly = False End If End Sub
Error occur on "Workbook.ReadOnly" lines:confused: .
I also want to put an errorchecking code for invalid passwords.
Again, I know I can use the "save as" option but that is not what I need.