R
Rich G.
Last week, I successfully ran Brian Kennemer's macro (MPA's Project Network
Newsletter Vol. 9, Issue 2 - 2005) which copies information from a task
outline code into the assignment values for each task using a Resource
Outline Code. I got the result my client needed in Portfolio Analyzer.
Now the macro below won't run. I'm not sure why. Any help is appreciated.
As a note, I'd like to hook up with someone who can help on these types of
issues - for pay. Here's the macro:
Sub Transfer_Task_Codes()
Dim tskT As Task
Dim asnA As Assignment
On Error GoTo ErrorHandler
If Application.Projects.Count > 0 Then
If ActiveProject.Tasks.Count > 0 Then
For Each tskT In ActiveProject.Tasks
If Not (tskT Is Nothing) Then
For Each asnA In tskT.Assignments
asnA.EnterpriseResourceOutlineCode2 = _
tskT.EnterpriseOutlineCode1
Next asnA
End If
Next tskT
End If
End If
Exit Sub
ErrorHandler:
MsgBox prompt:=Err.Description & Chr(13) & "In Task: " _
& tskT.ID & Chr(13) & "In Assignment: " & asnA.UniqueID, _
Buttons:=vbCritical, Title:="Code Transfer Error"
End Sub
Private Sub Project_BeforeClose(ByVal pj As Project)
Transfer_Task_Codes
End Sub
Newsletter Vol. 9, Issue 2 - 2005) which copies information from a task
outline code into the assignment values for each task using a Resource
Outline Code. I got the result my client needed in Portfolio Analyzer.
Now the macro below won't run. I'm not sure why. Any help is appreciated.
As a note, I'd like to hook up with someone who can help on these types of
issues - for pay. Here's the macro:
Sub Transfer_Task_Codes()
Dim tskT As Task
Dim asnA As Assignment
On Error GoTo ErrorHandler
If Application.Projects.Count > 0 Then
If ActiveProject.Tasks.Count > 0 Then
For Each tskT In ActiveProject.Tasks
If Not (tskT Is Nothing) Then
For Each asnA In tskT.Assignments
asnA.EnterpriseResourceOutlineCode2 = _
tskT.EnterpriseOutlineCode1
Next asnA
End If
Next tskT
End If
End If
Exit Sub
ErrorHandler:
MsgBox prompt:=Err.Description & Chr(13) & "In Task: " _
& tskT.ID & Chr(13) & "In Assignment: " & asnA.UniqueID, _
Buttons:=vbCritical, Title:="Code Transfer Error"
End Sub
Private Sub Project_BeforeClose(ByVal pj As Project)
Transfer_Task_Codes
End Sub