B
Bill B
It seems to me that Project 2007 (Professional SP1) runs much slower than
earlier versions. I have a test project with 2400 tasks. When I run the
following code in Project 2002 or 2003, it runs in about .1 seconds. When I
run it in Project 2007, it runs in about 1.15 seconds. I have all automatic
calculation turned off in both systems.
Sub TestTasks(pj As Project)
Dim t As Task, t0 As Single
t0 = Timer
For Each t In pj.Tasks
t.Flag2 = Not t.Flag2
Next
MsgBox "Task write for " & pj.Tasks.Count & " tasks took " &
Format(Timer - t0, "00000.00")
End Sub
Can someone confirm this for me? Similar code for resource assignments
(below) seems to run even slower. There really shouldn't be any processing
going on when this code runs.
Sub TestAssmts(pj As Project)
Dim t As Task, a As Assignment, l As Long, t0 As Single, t1 As Single,
tassign As Single
t0 = Timer
pj.ProjectSummaryTask.Flag13 = True
For Each t In pj.Tasks
For Each a In t.Assignments
l = l + 1
t1 = Timer
a.Flag14 = 0
a.Number13 = 0
a.Number14 = 0
a.Number15 = 0
a.Number16 = 0
a.Number17 = 0
a.Number18 = 0
tassign = tassign + Timer - t1
Next
Next
MsgBox "Resource write took " & Format(Timer - t0, "00000.00") & ": " &
Format(tassign, "00000.00") & " to make assignments"
End Sub
Thanks,
Bill B
earlier versions. I have a test project with 2400 tasks. When I run the
following code in Project 2002 or 2003, it runs in about .1 seconds. When I
run it in Project 2007, it runs in about 1.15 seconds. I have all automatic
calculation turned off in both systems.
Sub TestTasks(pj As Project)
Dim t As Task, t0 As Single
t0 = Timer
For Each t In pj.Tasks
t.Flag2 = Not t.Flag2
Next
MsgBox "Task write for " & pj.Tasks.Count & " tasks took " &
Format(Timer - t0, "00000.00")
End Sub
Can someone confirm this for me? Similar code for resource assignments
(below) seems to run even slower. There really shouldn't be any processing
going on when this code runs.
Sub TestAssmts(pj As Project)
Dim t As Task, a As Assignment, l As Long, t0 As Single, t1 As Single,
tassign As Single
t0 = Timer
pj.ProjectSummaryTask.Flag13 = True
For Each t In pj.Tasks
For Each a In t.Assignments
l = l + 1
t1 = Timer
a.Flag14 = 0
a.Number13 = 0
a.Number14 = 0
a.Number15 = 0
a.Number16 = 0
a.Number17 = 0
a.Number18 = 0
tassign = tassign + Timer - t1
Next
Next
MsgBox "Resource write took " & Format(Timer - t0, "00000.00") & ": " &
Format(tassign, "00000.00") & " to make assignments"
End Sub
Thanks,
Bill B