Task Type

  • Thread starter Maximiliano Marasso
  • Start date
M

Maximiliano Marasso

Hi,
I have an mpx file that I import to MS Project 2000. Then I run a macro
that sets the task type for each task that is in this archive to "Fixed Work"
(ActiveProject.Tasks(counter).Type = 2) through a loop. There is a lot of
code being run along with the previous one that mainly sets menu options and
prepares some views to be used.
The problem I'm facing is that in some cases this macro takes a few
seconds to complete but in others it takes around 20 minutes!

What's the problem with this macro? Please if you need more info let me
know.

Thank you very much
Max
 
R

Rod Gill

Hi,

Try:

Sub SetType()
Dim Tsk As Task
Application.Calculation = pjManual
For Each Tsk In ActiveProject.Tasks
If Not Tsk Is Nothing Then 'Test for blank task
Tsk.Type = pjFixedWork
End If
Next
Application.Calculation = pjAutomatic
End Sub

Blank tasks can stop macros. In a large schedule recalculating can take
time, so turning calc off then on again afterwards means only one recalc.
 
M

Maximiliano Marasso

Rod,
Thanks for your reply. It helped me a lot. I could reduce the time it
took to run the macro but it still takes too long in some cases. What I found
is that in those cases where the macro runs for a long period of time the MS
Project status bar says "Leveling...". I thought that leveling was related to
over-allocated resources instead of changes in the task type.
Does the change to the task type produce a re-adjustment of all the
resources associated to the task being changed?

Thanks again
Best regards
Max
 
J

Jan De Messemaeker

Hi,

This means that somewhere in the procedure you activate leveling.
That indeed may take time especially if there are anomalies such as a
resoruce being assigned to both a task and its summary task.

If leveling is set to automatic, put it to manual.
Look for resourceleveling in the code.
HTH
 

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