Home › Forums › Discussion Forum › Creating Backup Copies of .mpp Files Using a Macro
Tagged: Macro
MS Project 2013 Standard
My Internet connection is not exceptionally fast, so to speed up reading & writing and to reduce the potential of file corruption due to Internet disconnects, I store my .mpp files in a Folder on my laptop and upload Backup Copies to the corporate server for safekeeping.
I use a macro (shown below), that I added to the Quick Action Toolbar, to save Backup Copies of .mpp files.
The macro saves the current .mpp file and creates a duplicate .mpp file (Backup Copy) with the date and time of file creation appended to the file name.
Example:
Schedule_Project1.mpp
Schedule_Project1_2021-03-19-13-41.mpp (Backup Copy .mpp File created on 2021-03-19 at 1:41PM)
I wish to modify the macro to write the Backup Copy directly to the corporate server location instead of the Folder on my laptop.
However, after I modify the “FILESAVEAS” line of the macro to point to the server, MS Project does not seem to recognize the path to the corporate server location.
(Getting a “Compile Error : Syntax Error”)
Anyone aware of any special technique to address this issue? Thanks, KMD
==========================================================================
Sub InSituBackup()
‘ MS Project version
Dim dotIdx As Integer
Dim fileName As String
fileName = ActiveProject.FullName
dotIdx = InStrRev(fileName, “.”)
If dotIdx > 0 Then
Dim backupDisplayAlerts As Boolean
FileSaveAs Left(fileName, dotIdx – 1) & _
Format(Date, “_yyyy-mm-dd”) & _
Format(Time, “-hh-mm”) & _
“.” & _
Right(fileName, Len(fileName) – dotIdx)
backupDisplayAlerts = DisplayAlerts
DisplayAlerts = False
FileSaveAs fileName
DisplayAlerts = backupDisplayAlerts
Else
MsgBox “Unsaved file”, vbCritical
End If
End Sub
The .mpp file is a Microsoft Powerpoint presentation. It’s one of the most common files used in presentations and it has the same format for all versions of Powerpoint. Visit this https://premieressaywriting.com/ site to get best ideas. The .mpp file format is used because it allows multiple slides to be stored in a single file, which makes it easy to back up and distribute large presentations.