none
Extract "Resource Usage" from MS Project to XML RRS feed

  • Question

  • Summary:

    I need help extracting MS Project Resource Usage data to XML.

     

    Environment:

    C#/.NET, Project 2010, 2007, and 20/03 standalone.

     

    Scenario:

    I need a program that can extract the information from the "Resource Usage" view of MS Project into XML (and eventually into Excel). There is another step in between that needs to map resource names to official resource names but I'm not there yet.

     

    The Resource Usage view:

    Shows each worker ("Resource") associated with the hours they are projected to work for each "Task" for each Month.

     

    Issue:

    I am able to open up the project file in C#. I'm able to access various things (People's names, their total hours, tasks, etc. etc.). But I'm having trouble finding where the mappings are saved between workers and tasks and months. I was hoping to go with the following:

    1. Go through each worker:

    foreach
    


    (MSProject.Resource resource in


    proj.Resources)

     

    2. For each worker find the mapping between task and hours per month. I've tried various things. I'll just give you one example. I tried:

    tsVals = resource.TimeScaleData("1/1/2009"
    , "1/1/2020"
    );
    ...
    System.Collections.IEnumerator i = tsVals.GetEnumerator();
    while (i.MoveNext())
    {
    i.Current... // try to save the current TimeScaleData to XML
    }

     

    The problem is i.Current is nothing useful. When I print i.Current.GetType().ToString() it gives me "System.__ComObject"

     

    Any help is appreciated. I would also like to avoid writing any VBA for this.


    Code for honor.
    Thursday, March 3, 2011 6:02 AM

All replies