Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Oct 2003
    Location
    Toronto, Ontario, Canada
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Project Summary data (Project 2003)

    Anyone know where the data is stored for the Project Summary Task (Outline Level = 0)?
    I am trying to grab data from Excel VBA and Task 0 doesn't seem to exist.

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Project Summary data (Project 2003)

    Try the Tasks table and look at the Task_Outline_Num Field where it is zero.
    Regards,

    Gary
    (It's been a while!)

  3. #3
    Lounger
    Join Date
    Oct 2003
    Location
    Toronto, Ontario, Canada
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Project Summary data (Project 2003)

    Hi Gary, As you can see below, I loop through all tasks, but found that there are none with an outline level of zero. I suspect that this is a faked entry and may be at the project level. I am really interested in the % Complete data element, as I can sum the rest.

    Stu

    Sub GetProjectData()
    Dim prjApp As MSProject.Application
    Dim prjProject As MSProject.Project
    Dim Temp As Long, A As Assignment
    Dim TaskPercentComplete As Double
    Dim ActualWork As Double
    Dim Results As String

    Set prjApp = CreateObject("Msproject.Application")

    prjApp.FileOpen "Documents and SettingssboasmanDesktopInterfaces - Build Phase 1 plan.mpp", ReadOnly:=True

    Set prjProject = prjApp.ActiveProject
    Sheets("Summary").Select

    Range("A6").Select
    For Temp = 1 To prjProject.Tasks.Count
    If prjProject.Tasks(Temp).OutlineLevel = 0 Then
    Results = MsgBox(prjProject.Tasks(Temp).Name, vbOKOnly, "Level 0 Task found!")
    End If
    If prjProject.Tasks(Temp).OutlineLevel < 2 And prjProject.Tasks(Temp).Name <> "Resources on loan" And prjProject.Tasks(Temp).Name <> "Milestones-Premium Pricing Scan" Then
    ActiveCell.FormulaR1C1 = prjProject.Tasks(Temp).Name ' A
    ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Activate
    ActiveCell.FormulaR1C1 = prjProject.Tasks(Temp).Finish ' B
    ActiveCell.Offset(rowOffset:=0, columnOffset:=2).Activate
    ActiveCell.FormulaR1C1 = prjProject.Tasks(Temp).Work / 60 ' D
    ActiveCell.Offset(rowOffset:=0, columnOffset:=3).Activate
    ActiveCell.FormulaR1C1 = prjProject.Tasks(Temp).ActualWork / 60 ' G
    ActiveCell.Offset(rowOffset:=0, columnOffset:=3).Activate
    TaskPercentComplete = prjProject.Tasks(Temp).PercentComplete / 100 ' J
    If TaskPercentComplete > 0 Then
    ActiveCell.FormulaR1C1 = TaskPercentComplete
    End If
    ActiveCell.Offset(rowOffset:=1, columnOffset:=-9).Activate
    End If
    Next Temp

    prjApp.FileClose pjDoNotSave
    prjApp.Quit

    Set prjProject = Nothing
    Set prjApp = Nothing
    End Sub

  4. #4
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Project Summary data (Project 2003)

    Stu,

    You are correct in that the overall project summary task outline level is zero. Hovever, you do not seem to be getting any results. So this could mean that your project does not have an overall summary task (possible but it sounds as if you would have one) or you could just be missing the data. You start your loop from 1. Did you try starting from 0?

    A better way to loop through the data may be something like this:

    Dim T as task
    Dim TaskCount as Integer

    For each T in ActiveProject.Tasks
    'do whatever
    Next T

    This way you will always get all active tasks. HTH
    Regards,

    Gary
    (It's been a while!)

  5. #5
    Lounger
    Join Date
    Oct 2003
    Location
    Toronto, Ontario, Canada
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Project Summary data (Project 2003)

    I tried starting at zero and get a boundary error (lower limit is 1). The summary task is the default one that is always there, but displayed based on option settings. I suspect that this data is either stored at the project level or is derived and dynamically displayed. I am hoping it is stored so I can retrieve it from somewhere.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •