2014-02-20 5 views
0

저는 Primavera P6에서 ms xml을 내보내고 MS Project에서 가져옵니다. 나는 Primavera에서 관계의 수를 알고있다. 그러나 모든 관계가 MSP로 수입되는지 확실하지 않습니다. 누구든지 MS 프로젝트에서 관계의 수를 찾는 방법을 말해 줄 수 있습니까? Microsoft Project에서 카운트 관계

+1

왜이 질문이 다운 되었습니까? –

답변

2

예를 제안하십시오 - 당신은 당신의 프로젝트에 다음 코드를 실행하는 경우, 그것은 많은 의존성이 프로젝트에 정의 된 방법을 알리는 대화 상자가 생성됩니다

Sub CountDependencies() 

Dim i_RelationshipCount As Integer 
Dim tsk As Task 
Dim tsk_dep As TaskDependency 

i_RelationshipCount = 0 

For Each tsk In ActiveProject.Tasks 
    If tsk Is Nothing Then GoTo NextTask 
    For Each tsk_dep In tsk.TaskDependencies 
     'only count predecessors (otherwsie will count each realtionship twice) 
     If tsk_dep.To = tsk Then 
      i_RelationshipCount = i_RelationshipCount + 1 
     End If 
    Next tsk_dep 
NextTask: 
Next tsk 

MsgBox i_RelationshipCount & " dependencies/relationships exist in this schedule." 

End Sub 
2

AndrewEversight의 대답 @ 것은 완전히 정확합니다. FWIW : 동일한 결과를 제공하는 작은 루틴은 다음과 같습니다.

Sub CountDependencies() 

Dim i_RelationshipCount As Integer 
Dim tsk As Task 

i_RelationshipCount = 0 

For Each tsk In ActiveProject.Tasks 
    If Not tsk Is Nothing Then 
     i_RelationshipCount = i_RelationshipCount + tsk.PredecessorTasks.Count 
    End If 
Next tsk 

MsgBox i_RelationshipCount & " dependencies/relationships exist in this schedule." 

End Sub