locked
How to use VBA extract the manpower histogram(Answered) RRS feed

  • Question

  • Hi all! 1st ly I want to thank the contributors to this forum i have been saved by this forum a few times.

    This is concerning MS project 2010, the kind of planning I do is effort driven with resource for each task. After linking my task I go to Resource sheet, check Detail and then select Resource Graph and then MS project 2010 will display the manpower histogram.

    However I want to be able to extract the actual data that created this histogram. I couldn't find any functon to do that so I presume that I will have to use VBA to do it. I have search for the right object and method to use to do this but I couldn't find what I want. Can someone please let me know the object and methods to use to get what I need??? Or whatever method to get the data out. Thanks.

    The ideal data is something like this

    A(x:1)-->Date

    A(x:2)-->manpower.

    I think you get the picture.


    Saturday, October 27, 2012 3:44 AM

Answers

  • The Architect1013,

    The histogram already shows the date at the top of the graph. The timescale can be changed as needed. The x-axis shows peak units by default but can show other parameters by right clicking on the x-axis value to bring up the list of available fields.

    And no, I'm sorry but I don't "get the picture". What exactly is "A(x:1)" and "A(x:2)"? And where are you expecting to display your date and manpower? On the histogram?

    Note: You can create virtually any format report you need using VBA but 99.44% of the time it will necessitate export of Project data to Excel since Project has very limited graphic capability. My understanding is that Project 2013 has improved on this capability.

    To answer your specific VBA question, the TimeScaleData Method is applicable to the Task, Resource and Assignment objects. Syntax is detailed in the object browser, accessible through the VB Editor window.

    John

    Saturday, October 27, 2012 4:34 PM

All replies

  • The Architect1013,

    The histogram already shows the date at the top of the graph. The timescale can be changed as needed. The x-axis shows peak units by default but can show other parameters by right clicking on the x-axis value to bring up the list of available fields.

    And no, I'm sorry but I don't "get the picture". What exactly is "A(x:1)" and "A(x:2)"? And where are you expecting to display your date and manpower? On the histogram?

    Note: You can create virtually any format report you need using VBA but 99.44% of the time it will necessitate export of Project data to Excel since Project has very limited graphic capability. My understanding is that Project 2013 has improved on this capability.

    To answer your specific VBA question, the TimeScaleData Method is applicable to the Task, Resource and Assignment objects. Syntax is detailed in the object browser, accessible through the VB Editor window.

    John

    Saturday, October 27, 2012 4:34 PM
  • The Architect1013,

    The histogram already shows the date at the top of the graph. The timescale can be changed as needed. The x-axis shows peak units by default but can show other parameters by right clicking on the x-axis value to bring up the list of available fields.

    And no, I'm sorry but I don't "get the picture". What exactly is "A(x:1)" and "A(x:2)"? And where are you expecting to display your date and manpower? On the histogram?

    Note: You can create virtually any format report you need using VBA but 99.44% of the time it will necessitate export of Project data to Excel since Project has very limited graphic capability. My understanding is that Project 2013 has improved on this capability.

    To answer your specific VBA question, the TimeScaleData Method is applicable to the Task, Resource and Assignment objects. Syntax is detailed in the object browser, accessible through the VB Editor window.

    John

    Thanks for the hint at the end. Yes MS project have in built histogram but I am scheduling for projects lasting more than 200 days sometimes and so I want to break it down into months and plot it in perhaps excel, 1 worksheet for 1 month(for various manpower) and then save it as PDF.

    Being me I want to automate everything so that is why I asked.

    As for "A(x,1)" and "A(x,2)" That is just an array I hope to store the histogram so that I can perhaps graphically display it with R straight away(better graphics) or do more calculation with it in the future. I made a mistake using ":" should be ",".

    I am afraid if I use visual report I will be unable to use VBA to pull out specific data from the cube.

    A big thanks!

    Saturday, October 27, 2012 5:03 PM
  • TheArchitect1013,

    You could probably pull the data into a pivot table using visual reports but there have been some issues with the visual reports feature and to use it effectively the user needs to fully understand pivot tables. I find many users have trouble with pivot tables. Personally if I need a custom report, I go straight to VBA. In my opinion it's much easier to set up and control.

    You're welcome. If this answered your question please mark it a so.

    John

    Saturday, October 27, 2012 8:18 PM