J
Jeff
I want to selectively omit certain records during import using the
following code. How should I do it? What syntax is required.
Thanks
Jeff
'Copy Data
Set xlR = xlR.Offset(1, 0)
For Each Proj In Projects
'Use Subject field if it's not empty, otherwise the Title
field
If Proj.BuiltinDocumentProperties("Subject") = "" Then
ProjectName = Proj.BuiltinDocumentProperties("Subject")
Else
ProjectName = Proj.BuiltinDocumentProperties("Title")
End If
For Each R In Proj.Resources
For Each A In R.Assignments
xlR.Range("A1:E1") = Array(A.ResourceName,
A.TaskName, ProjectName, A.Work / 60, A.Cost)
'Export Time Phased Data
Set Tsvs = A.TimeScaleData(DateSerial(Year(Date),
Month(Date), 1), DateSerial(Year(Date), Month(Date) + 12, 1 - 1),
pjAssignmentTimescaledWork, pjTimescaleMonths)
For Each Tsv In Tsvs
If Tsv.Value <> "" Then 'If there is a
value to export
i = Month(Tsv.StartDate) -
Month(Date)
If i < 0 Then
i = i + 12
End If
xlR.Offset(0, i + 5) = Tsv.Value /
60
End If
Next
Set xlR = xlR.Offset(1, 0)
'point to next row in Excel
Next
Next
Next
following code. How should I do it? What syntax is required.
Thanks
Jeff
'Copy Data
Set xlR = xlR.Offset(1, 0)
For Each Proj In Projects
'Use Subject field if it's not empty, otherwise the Title
field
If Proj.BuiltinDocumentProperties("Subject") = "" Then
ProjectName = Proj.BuiltinDocumentProperties("Subject")
Else
ProjectName = Proj.BuiltinDocumentProperties("Title")
End If
For Each R In Proj.Resources
For Each A In R.Assignments
xlR.Range("A1:E1") = Array(A.ResourceName,
A.TaskName, ProjectName, A.Work / 60, A.Cost)
'Export Time Phased Data
Set Tsvs = A.TimeScaleData(DateSerial(Year(Date),
Month(Date), 1), DateSerial(Year(Date), Month(Date) + 12, 1 - 1),
pjAssignmentTimescaledWork, pjTimescaleMonths)
For Each Tsv In Tsvs
If Tsv.Value <> "" Then 'If there is a
value to export
i = Month(Tsv.StartDate) -
Month(Date)
If i < 0 Then
i = i + 12
End If
xlR.Offset(0, i + 5) = Tsv.Value /
60
End If
Next
Set xlR = xlR.Offset(1, 0)
'point to next row in Excel
Next
Next
Next