Macros

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
 
J

Jayalakshmi

Hi Jan,

Thanks for your reply!

But i couldn't get your point. Can you please tell me clearly!

Regards,
Jaya
 
J

Jan De Messemaeker

Hi,

You puzzle me, I thought this was as clear as I could.
Let me try again.
In your code you have a line If not Tsk is Nothing then
Below that line add this line
If not Tsk.summary then

And before the line Next Tsk add the line
End If

Hope this helps.

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 
M

Mike Glen

Hi Jaya,

Next time, try posting on the microsoft.public.project.developer newsgroup.
Please see FAQ Item: 24. Project Newsgroups. FAQs, companion products and
other useful Project information can be seen at this web address:
http://project.mvps.org/faqs.htm

Mike Glen
Project MVP
 
M

Mike Glen

Sorry!!!!!!!!!!!!! I was in the wrong newsgroup!!!!!!! My apologies.


Mike Glen
Project MVP
 

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