Saving Read Only

cogswel__cogs

Board Regular
Joined
Jan 3, 2018
Messages
98
I have a file that I am using as a template for divisions to retrieve productivity report.

So when user opens (Read only), he then logs in and their particular division(s) data will open.

Since it is read only. I t prevents people from saving over the file so all can use as a template and I don't need to worry about them saving over the file. They are instructed to save in their own folder and do work thy need.

The problem I am having is when they save to there own folder it is still read only.
Is the best way to stop this writing a macro to see if the name or location has changed and if so removing the Read only property.
Is this even possible?
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

cogswel__cogs

Board Regular
Joined
Jan 3, 2018
Messages
98
Found couple of hints and was able to write this Seems to work.


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Dim xPath As String
xPath = Application.ActiveWorkbook.Path


If Right(xPath, 5) <> "tions" Then

With ThisWorkbook
.ChangeFileAccess Mode:=xlReadWrite, WritePassword:="Password"
End With

End If


End Sub
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,099,569
Messages
5,469,462
Members
406,653
Latest member
CBeeker

This Week's Hot Topics

Top