J
Jayalakshmi
Hi All,
Help me!
I am using below specified Macro in MS Project Professional 2003. This macro
is running & i am getting result in which project is not having WBS. If a
project is having WBS, Macro is not running & its showing error that "This
argument is not
valid". What to do? Can you give solution for this?
Sub Material_Cost()
Dim Tsk As Task
Dim Res As Resource
Dim Assgn As Assignment
For Each Tsk In ActiveProject.Tasks
If Not Tsk Is Nothing Then
Tsk.EnterpriseCost1 = 0
For Each Assgn In Tsk.Assignments
Set Res = ActiveProject.Resources(Assgn.ResourceID)
If Res.Type = pjResourceTypeMaterial Then
Tsk.EnterpriseCost1 = Tsk.EnterpriseCost1 + Assgn.Cost
End If
Next Assgn
End If
Next Tsk
End Sub
Thanks in Advance!
Regards,
Jaya
Help me!
I am using below specified Macro in MS Project Professional 2003. This macro
is running & i am getting result in which project is not having WBS. If a
project is having WBS, Macro is not running & its showing error that "This
argument is not
valid". What to do? Can you give solution for this?
Sub Material_Cost()
Dim Tsk As Task
Dim Res As Resource
Dim Assgn As Assignment
For Each Tsk In ActiveProject.Tasks
If Not Tsk Is Nothing Then
Tsk.EnterpriseCost1 = 0
For Each Assgn In Tsk.Assignments
Set Res = ActiveProject.Resources(Assgn.ResourceID)
If Res.Type = pjResourceTypeMaterial Then
Tsk.EnterpriseCost1 = Tsk.EnterpriseCost1 + Assgn.Cost
End If
Next Assgn
End If
Next Tsk
End Sub
Thanks in Advance!
Regards,
Jaya