Quick Links

Creating Backup Copies of .mpp Files Using a Macro

Home Forums Discussion Creating Backup Copies of .mpp Files Using a Macro


  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #482431 Reply

    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.

    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
    MsgBox “Unsaved file”, vbCritical
    End If

    End Sub

Viewing 1 post (of 1 total)
Reply To: Creating Backup Copies of .mpp Files Using a Macro
Your information:

12 − = 5