none
Download projects from Project Online RRS feed

  • Question

  • HI, I have about 45 projects I want to download copies for from Project Online.   Can anyone suggest any VBA to achieve this?

    Thanks Steve

    Tuesday, April 21, 2020 1:13 PM

Answers

  • The issue is getting a list of all projects. One solution is using VBA and Odata. See:

    https://docs.microsoft.com/en-us/archive/blogs/marcelolr/consuming-odata-with-office-vba-part-i

    Otherwise create a list of the projects in a project, one per task.

    In Text1 for each task enter the path of the destination folder

    Then:

    Sub Save()
    Dim Tsk As Task
        For Each Tsk In ActiveProject.Tasks
            If Not Tsk Is Nothing Then
                FileOpen "<>\" & Tsk.Name
                FileSaveAs Tsk.Text1 & "\" & Tsk.Name
                FileClose pjDoNotSave
            End If
        Next Tsk
    End Sub

    WARNING: I haven't tested this code so single step thru to test it.


    Rod Gill
    Author of the one and only Project VBA Book and VBA developer.
    www.project-systems.co.nz

    • Marked as answer by Steve Yorks Wednesday, July 8, 2020 7:54 AM
    Sunday, May 3, 2020 2:23 AM
    Moderator

All replies

  • Hi,

    Maybe Rod or John will jump in, they could help you with VBA.

    That being said, for 45 projects, it might be faster to do it manually (save as).


    Hope this helps,


    Guillaume Rouyre, MBA, MVP, P-Seller

    Saturday, May 2, 2020 1:02 PM
    Moderator
  • The issue is getting a list of all projects. One solution is using VBA and Odata. See:

    https://docs.microsoft.com/en-us/archive/blogs/marcelolr/consuming-odata-with-office-vba-part-i

    Otherwise create a list of the projects in a project, one per task.

    In Text1 for each task enter the path of the destination folder

    Then:

    Sub Save()
    Dim Tsk As Task
        For Each Tsk In ActiveProject.Tasks
            If Not Tsk Is Nothing Then
                FileOpen "<>\" & Tsk.Name
                FileSaveAs Tsk.Text1 & "\" & Tsk.Name
                FileClose pjDoNotSave
            End If
        Next Tsk
    End Sub

    WARNING: I haven't tested this code so single step thru to test it.


    Rod Gill
    Author of the one and only Project VBA Book and VBA developer.
    www.project-systems.co.nz

    • Marked as answer by Steve Yorks Wednesday, July 8, 2020 7:54 AM
    Sunday, May 3, 2020 2:23 AM
    Moderator
  • Belated response Rod,  I went down the route you suggested and it worked perfectly.

    Thanks

    Steve

    Wednesday, July 8, 2020 7:54 AM