It’s often required that project manager /administrator in project server wants to track the changes done in the project plan or take the backup of a project plan for further reference. There can be a manual way to perform this action by Opening each project and saving the project plan from the project professional.
In this blog, we are going to automate the process by creating a macro in VBA that will allow the administrator to take the backups of all the project without manually opening each project.
A STEP BY STEP GUIDE TO GET THIS DONE IN MINUTES
Get the List of Project in Excel using Odata
Create a list of the projects for which you would like to export the MPP file. We will get the list of projects using Odata from project server in an Excel file and now follow these commands:
• Create a new Excel file.
• Go to Data Tab and in Get External Data Section, Select 'From Odata Data Feed' as shown below
• In the pop up window, enter the Odata Url of get the project server
/_api/ProjectData/Projects()?$Select=ProjectName
• Click on Next
• Another Pop window will appear, Enter the User Name and Password
• Pop window will come to Select Projects Table
• Click on Next, enter the name of data connection file.
• Click on Finish.
• Another POP window will come for Import Data as shown below, click on OK button
• Now List of Projects from Project Server will be displayed as shown below.
• To get the refresh list of project, go to Data Tab, Click on Refresh All. This will update the project list from project server.
Take the Backup of the Project Plan
• Open Microsoft Project File “Backup Project Plan. Mpp” and Login with the PWA account for which backup is required.
• Copy the Project Names from Excel from Step 1 into to a mpp as shown below
• If the Developer tab is not visible in Ribbon of Project Professional, go to File -> Options – > Customize Ribbon ? Check the Developer check box and Click OK
• Go to Developer tab and click on Visual Studio
Visual basic editor will open and there will in the Module1 as shown below and Now Run the module from the ribbon button as highlighted.
This will open the project one by one and create the mpp file in the Exports folder set up in C drive as mentioned in above script.
Conclusion:
Using this approach project administrator can easily task the back of project plan. This mpp files can be used for reference in future.