none
Disable Save or Save As for Read Only mpp file RRS feed

  • Question

  • Hi,

    I have a read only mpp file and need to make sure that it cannot be Saved / Saved As by anybody in Team. They should only have access to view the file.

    How can enable a file which does not allow save / save as?

    Tuesday, August 26, 2014 5:19 PM

All replies

  • ihvarrived,

    Normally I'd say this isn't possible with Project but I challenged myself to find a way to do it and indeed I did, although it will be a little inconvenient for you. But, before I explain the method, let me give you a better approach. The best approach is training. Lay down a ground rule for your team that says only select people (maybe only you) is authorized to make changes and save. There may well be other ground rules that are also worth establishing. This approach actually works very well because members of a good team want to work together and will respect rules if they make sense. That's how we did it at the company where I worked. Yes, there may be an occasional misstep, but that's why there are checks and balances (e.g. good project management and backup files).

    Okay, now the covert approach. Create a BeforeSave event that asks for a change password. If the password is incorrect, the event macro could select all data and delete it. The save would occur but the saved file would be blank. This also works if the user attempts a Save As. The downside is you will need to use Save As to a new file name (as backup) each time you want to save with changes. If a team member does attempt to save and zeros out the file, you have the backup. Even though Project 2010 introduced a new EventInfo object that can be used to cancel an event, it doesn't work with the BeforeSave event. Too bad.

    If you would like further instructions on how to set up the even macro, let me know and I'll post details.

    John

    Tuesday, August 26, 2014 11:24 PM
  • Hi,

    The "Open Project" permission will help open the project only in read only mode:

    The details of Open Project permission is:

    Allows a user to open a project from the Project Server database in read-only mode by using Project Professional. Grant this permission to any member of your organization who has to use the Open from Microsoft Project Server dialog box in Project Professional or in the Project Center in Project Web App to open projects that have been saved to the Project Server database. If users are not assigned the Save Project to Project Server permission, then the project will only be open in read-only mode.

    The following article provides the details:

    http://technet.microsoft.com/en-us/library/cc197622(v=office.15).aspx

    Cheers!!! Happy Troubleshooting!!!

    Shiva Prasad B C

    Wednesday, August 27, 2014 12:03 AM
  • Can you please provide more details in BeforeSave event?
    Thursday, August 28, 2014 12:39 PM
  • ihvarrived,

    You didn't mention anything about being in a Project Server environment, so I assume Shiva's response has no meaning for you.

    With regard to an approach to prevent unauthorized users from saving a file let me again stress that, in my opinion, the best approach for this issue is training. That has the great advantage of mutual respect and cooperative effort in a team environment.

    To implement a more covert approach you will need to do the following:

    1. With the file open go to Developer/Code group/Visual Basic

    2. Hit the Project Explorer icon

    3. In the Explorer hierarchy, under the VBAProject double click on the "ThisProject"

    4. In the code window, paste the following code:

    Private Sub project_open(ByVal pj As MSProject.Project)
    MsgBox "This file is write protected. You can make changes" & vbCr & _
        "for temporary what-if scenarios, but you will not be" & vbCr & _
        "able to save without the correct password", vbExclamation, "Warning!"
    End Sub

    Private Sub project_beforesave(ByVal pj As MSProject.Project)
    pass = InputBox("enter save password")
    If pass <> "xyz" Then  'string in quotes is the password you chose for saving, "xyz" is for illustration only
        SelectAll
        EditDelete
    End If
    End Sub

    5. While still in the code window, go to Tools/VBA Project Properties/Protection tab

    6. Check the "Lock this project" option

    7. Enter and confirm a password. It can be the same as your save password or a different password (This will insure that only you can view and modify the above code)

    8. Hit OK, then File/Save [your filename] to capture your macro in the file. Note, at this point you will be required to enter your save password.

    Be advised that if a user does attempt to save without the correct save password, the file will be zeroed out and saved (i.e. nothing). That means that whenever you save the file you should also save a backup under a different name, so you can restore the file if necessary. I couldn't figure out a good way to work around this problem. If the user always tries a "Save As" this wouldn't be an issue, but if they chose "Save" and you don't have a backup, you're screwed.

    If this answers your question or is at least helpful, please mark it accordingly.

    John


    • Edited by John - Project Thursday, August 28, 2014 3:46 PM full covert action
    Thursday, August 28, 2014 3:13 PM