M
meliskey
I am trying to get at the assignment data (in VBA), but every time I chage
this code to go against resource or assignment it gives me a generic error.
Any help would be apprechated.
Sub WorkHoursPerDay()
Dim TSV As TimeScaleValues, HowMany As Long
Dim HoursPerDay As String
Set TSV = ActiveCell.Task.timescaledata("8/1/06", "8/30/06",
pjTaskTimescaledBaseline10Work, TimescaleUnit:=pjTimescaleWeeks)
For HowMany = 1 To TSV.Count
If TSV(HowMany).Value = "" Then
HoursPerDay = HoursPerDay & TSV(HowMany).StartDate & " - " & _
TSV(HowMany).EndDate & ": 0 hours" & vbCrLf
Else
HoursPerDay = HoursPerDay & TSV(HowMany).StartDate & " - " & _
TSV(HowMany).EndDate & ": " & TSV(HowMany).Value / 60 & _
" hours" & vbCrLf
End If
Next HowMany
MsgBox HoursPerDay
End Sub
this code to go against resource or assignment it gives me a generic error.
Any help would be apprechated.
Sub WorkHoursPerDay()
Dim TSV As TimeScaleValues, HowMany As Long
Dim HoursPerDay As String
Set TSV = ActiveCell.Task.timescaledata("8/1/06", "8/30/06",
pjTaskTimescaledBaseline10Work, TimescaleUnit:=pjTimescaleWeeks)
For HowMany = 1 To TSV.Count
If TSV(HowMany).Value = "" Then
HoursPerDay = HoursPerDay & TSV(HowMany).StartDate & " - " & _
TSV(HowMany).EndDate & ": 0 hours" & vbCrLf
Else
HoursPerDay = HoursPerDay & TSV(HowMany).StartDate & " - " & _
TSV(HowMany).EndDate & ": " & TSV(HowMany).Value / 60 & _
" hours" & vbCrLf
End If
Next HowMany
MsgBox HoursPerDay
End Sub