Macro won't run

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
 
R

Rich G.

Hi Rod,

Thanks for responding.

There is no error indicated. When I select "Run", nothing happens. Last
week it worked like a charm. It's peculiar because I did not change the code.
 
J

Jan De Messemaeker

Hi,

This sound like a too high macro security.
Try setting it to low (Tools, Mcro, Security)
HTH
 
R

Rich G.

Jan & Rod,

After further review, I believe the macro did run. The value in the task
outline code was copied to the assignment level, but on the resource side
(Resource Usage view) only. I could have sworn that last week that the task
outline code value was also copied to the assignment level in the task usage
view - but no. Now I will reconcile using Portfolio Analyzer to see if the
reports meet our needs.

Thanks again for your help. I may well reach either of you directly should
consulting help be required.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top