J
JD
Hey guys, I'm importing my resources from another table, and they have a
column with an ID (Number1) that corresponds to which task they belong to.
This is the code I'm working with right now:
Sub Automatic_Resource_Assignment()
Dim Temp1 As Long
Dim Temp2 As Long
For Temp1 = 1 To ActiveProject.Resources.Count
For Temp2 = 1 To ActiveProject.Tasks.Count
If ActiveProject.Resources(Temp1).Number1 =
ActiveProject.Tasks(Temp2).ID Then ActiveProject.Tasks(Temp2).Assignments.Add
(ActiveProject.Resources(Temp1).ID)
Next Temp2
Next Temp1
End Sub
I'm getting an error on the long line saying the argument value is not
valid. My question is what is causing this error, and if this method should
work if I get it to run.
column with an ID (Number1) that corresponds to which task they belong to.
This is the code I'm working with right now:
Sub Automatic_Resource_Assignment()
Dim Temp1 As Long
Dim Temp2 As Long
For Temp1 = 1 To ActiveProject.Resources.Count
For Temp2 = 1 To ActiveProject.Tasks.Count
If ActiveProject.Resources(Temp1).Number1 =
ActiveProject.Tasks(Temp2).ID Then ActiveProject.Tasks(Temp2).Assignments.Add
(ActiveProject.Resources(Temp1).ID)
Next Temp2
Next Temp1
End Sub
I'm getting an error on the long line saying the argument value is not
valid. My question is what is causing this error, and if this method should
work if I get it to run.