Automatic timescale data update

N

Nathalie

Hi,
I would like to have an import of the monthly costs from our Excel
accounting report into Ms project. I want to import the values for all
activities month by month. That's why it has to be an import into the
timescale portion of the task usage view for example.
Could anyone give me some help to develop this macro?
thanks a lot
Nathalie
 
J

Jan De Messemaeker

Hi,

You will have to use the timescaledata method to define timescalevalues for
that.
It's not really easy but the Help on these two methods is very good and it
has examples.

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

king

this is my problem too..
i have create some script for this use timescaledate method, but for some
summary (that not have resource) i always fail..

can someone help me? please..
 
J

Jan De Messemaeker

Hi,

You cannot enter actual data for summary tasks, not manually, thus not
through a program either.
I's against Project's logic - Summary tasks are a rollup of children tasks.

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

king

hmmm..are u sure? :(
so..how about task usage view, it can show every workdays (increment) from
task or summary task?

my question is, how to get increment of workdays at the current date..?
i really need that..plaese someone help me..
 
J

Jan De Messemaeker

Hi,

For the first question: have you tried to enter Actual Work on a summary
task's level manually?
I'm sure that doesn't work because I can try it as many times as I want.

For the other question, maybe my English isn't good enough but I soimply
don't understand what you mean
Quote: how to get increment of workdays at the current date

Could you translate that into project terms like Actual Work, Work, ...?
You can enter Actual work for any day but not on summary task level.

HTH

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

Nathalie

Hi King,
could you please send me the script you wrote? it would really help me to
start.
thanks a lot.
Nathalie
 
K

king

hmm..i mean, if you see "task usage view" and you activate the cumulative
work at the right side, you will see that it always incremented every days, i
want create program like that (cumulative work at usage task) and write it to
one field at gantt chart, so my boss can see the report target at the current
date..

Sub CopyActuals()

Dim TSV As TimeScaleValue, TSV2 As TimeScaleValue
Dim TSVs As TimeScaleValues, TSVs2 As TimeScaleValues
Dim Tk As Task
Dim Ass As Assignment
'Dim TStart As Date, TFinish As Date
Dim i As Integer
'==========================================================================================================
Dim MyFile As String
Dim Tampung, Sn As String
Dim JumlahHour, Tamp1, Tamp2 As Long
Dim Hasil As Variant
Dim Persen As Long
MyFile = "C:\" & ActiveProject.Name & "_properties.txt"
fnum = FreeFile()
Open MyFile For Output As fnum
Tampung = ""
JumlahHour = 0
'==========================================================================================================
For Each Tk In ActiveProject.Tasks
i = 0
For Each Ass In Tk.Assignments
i = i + 1
Deb = Tk.Assignments(i).Start
Fin = Tk.Assignments(i).Finish

Set TSVs = Tk.Assignments(i).TimeScaleData("1/1/08",
"4/3/09", pjAssignmentTimescaledWork, pjTimescaleDays, 1)

For Each TSV In TSVs
'==========================================================================================================
If (Tk.Name <> Tampung) Then
Tampung = Tk.Name
End If

If (Tk.Name = Tampung) Then
JumlahHour = JumlahHour + Val(TSV.Value)
End If
'==========================================================================================================
Next TSV
'Write #fnum, Round(Tk.Work / 480, 1), JumlahHour / 480 & ";
d; ", Tk.Name, Ass.ResourceName, Tk.Work / 480; ""
If (Round((JumlahHour / 480), 1) >= Tk.Work) Then
Tamp1 = Round(Tk.Work / 480, 1)
Tamp2 = Round(Tk.Work / 480, 1)
Sn = "A"
If ((Round((JumlahHour / 480), 1) = 0) Or ((Tk.Work) =
0)) Then
Persen = 0
Else
Persen = (Round((JumlahHour / 480), 1) /
Round(Tk.Work / 480, 1)) * 100
If Persen > 100 Then
Persen = 100
End If
End If
End If
If (Round((JumlahHour / 480), 1) < Tk.Work) Then
Tamp1 = Round((JumlahHour / 480), 1)
Tamp2 = Round(Tk.Work / 480, 1)
Sn = "B"
If ((Round((JumlahHour / 480), 1) = 0) Or ((Tk.Work) =
0)) Then
Persen = 0
Else
Persen = (Round((JumlahHour / 480), 1) /
Round(Tk.Work / 480, 1)) * 100
If Persen > 100 Then
Persen = 100
End If
End If
End If

Write #fnum, "Target : " & Tamp1, "Baseline : " & Tamp2,
"Target (%) : " & Persen, Sn, Tk.Name, Tk.Summary, Tk.Index, Tk.OutlineLevel,
DateFormat(Tk.Start, vbLongDate), DateFormat(Date, vbLongDate)
Tk.Text25 = Persen & " %"
Next Ass
Tampung = Tk.Name
JumlahHour = 0
Next Tk
Close #fnum
End Sub
 
N

Nathalie

Thanks a lot!
Nathalie

king said:
hmm..i mean, if you see "task usage view" and you activate the cumulative
work at the right side, you will see that it always incremented every days, i
want create program like that (cumulative work at usage task) and write it to
one field at gantt chart, so my boss can see the report target at the current
date..

Sub CopyActuals()

Dim TSV As TimeScaleValue, TSV2 As TimeScaleValue
Dim TSVs As TimeScaleValues, TSVs2 As TimeScaleValues
Dim Tk As Task
Dim Ass As Assignment
'Dim TStart As Date, TFinish As Date
Dim i As Integer
'==========================================================================================================
Dim MyFile As String
Dim Tampung, Sn As String
Dim JumlahHour, Tamp1, Tamp2 As Long
Dim Hasil As Variant
Dim Persen As Long
MyFile = "C:\" & ActiveProject.Name & "_properties.txt"
fnum = FreeFile()
Open MyFile For Output As fnum
Tampung = ""
JumlahHour = 0
'==========================================================================================================
For Each Tk In ActiveProject.Tasks
i = 0
For Each Ass In Tk.Assignments
i = i + 1
Deb = Tk.Assignments(i).Start
Fin = Tk.Assignments(i).Finish

Set TSVs = Tk.Assignments(i).TimeScaleData("1/1/08",
"4/3/09", pjAssignmentTimescaledWork, pjTimescaleDays, 1)

For Each TSV In TSVs
'==========================================================================================================
If (Tk.Name <> Tampung) Then
Tampung = Tk.Name
End If

If (Tk.Name = Tampung) Then
JumlahHour = JumlahHour + Val(TSV.Value)
End If
'==========================================================================================================
Next TSV
'Write #fnum, Round(Tk.Work / 480, 1), JumlahHour / 480 & ";
d; ", Tk.Name, Ass.ResourceName, Tk.Work / 480; ""
If (Round((JumlahHour / 480), 1) >= Tk.Work) Then
Tamp1 = Round(Tk.Work / 480, 1)
Tamp2 = Round(Tk.Work / 480, 1)
Sn = "A"
If ((Round((JumlahHour / 480), 1) = 0) Or ((Tk.Work) =
0)) Then
Persen = 0
Else
Persen = (Round((JumlahHour / 480), 1) /
Round(Tk.Work / 480, 1)) * 100
If Persen > 100 Then
Persen = 100
End If
End If
End If
If (Round((JumlahHour / 480), 1) < Tk.Work) Then
Tamp1 = Round((JumlahHour / 480), 1)
Tamp2 = Round(Tk.Work / 480, 1)
Sn = "B"
If ((Round((JumlahHour / 480), 1) = 0) Or ((Tk.Work) =
0)) Then
Persen = 0
Else
Persen = (Round((JumlahHour / 480), 1) /
Round(Tk.Work / 480, 1)) * 100
If Persen > 100 Then
Persen = 100
End If
End If
End If

Write #fnum, "Target : " & Tamp1, "Baseline : " & Tamp2,
"Target (%) : " & Persen, Sn, Tk.Name, Tk.Summary, Tk.Index, Tk.OutlineLevel,
DateFormat(Tk.Start, vbLongDate), DateFormat(Date, vbLongDate)
Tk.Text25 = Persen & " %"
Next Ass
Tampung = Tk.Name
JumlahHour = 0
Next Tk
Close #fnum
End Sub
 
K

king

so..anyone can help me?
i just need how to take cumulative work for the current date, like task
usage view..
 

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