none
Writing MSP Timephased Data to Excel RRS feed

  • Question

  • Hi All

    I am trying to write Timephased Data from MSP to Excel.  I have a piece of code from Rod Gills book as my starting point and this is copied below with my changes so far.  What I need is help in modifying this code to include task data such as Resource Name. Once I have this I can work out how to write each line to an Excel file.  

    Any help would be appreciated.

    Thanks in anticipation.

    Tony

    Sub MPSTimePhasedDataTest()
    Dim tsv As TimeScaleValue
    Dim tsvs As TimeScaleValues
    Dim R As Long
    Dim t As Task
    
    'Timephased data
    
    For R = 1 To ActiveProject.Resources.Count
        Set tsvs = ActiveProject.Resources(R).TimeScaleData( _
        StartDate:=ActiveProject.ProjectStart, _
        EndDate:=ActiveProject.ProjectFinish, _
        Type:=pjResourceTimescaledWork, _
        TimeScaleUnit:=pjTimescaleWeeks, Count:=1)
        For Each tsv In tsvs
            Debug.Print ActiveProject.Tasks(R).OutlineParent.ResourceNames & " " & tsv.Parent, "Start: " & Format(tsv.StartDate, _
            "Short Date"), "Work: " & Val(tsv.Value) / 450 & "d"
        Next tsv
    Next R
    End Sub
    
    


    TKHussar

    • Moved by Chenchen Li Thursday, January 5, 2017 11:22 AM
    Wednesday, January 4, 2017 10:47 AM

Answers

  • Tony,

    You can take Rod's basic structure and integrate it with the structure in the following link and you have what you want.

    https://social.technet.microsoft.com/wiki/contents/articles/32126.ms-project-truncated-project-notes-when-viewingexporting.aspx

    John

    • Marked as answer by TKHussar Tuesday, June 19, 2018 10:46 AM
    Thursday, January 5, 2017 8:46 PM

All replies

  • Hi,

    Sorry that we are not familiar with MS Project.

    For MS Project, there is specific forum, I would move this thread into Project Customization and Programming

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=project2010custprog

    Sorry for any inconvenience and have a nice day! 

    If you have any issue related to Excel object model, please feel free to post our forum.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 5, 2017 11:22 AM
  • Tony,

    You can take Rod's basic structure and integrate it with the structure in the following link and you have what you want.

    https://social.technet.microsoft.com/wiki/contents/articles/32126.ms-project-truncated-project-notes-when-viewingexporting.aspx

    John

    • Marked as answer by TKHussar Tuesday, June 19, 2018 10:46 AM
    Thursday, January 5, 2017 8:46 PM