-1

I am attempting to take status off of a task by setting the task.stop field to an earlier date using vba. I am getting a "Runtime Error 1101: The argument is not valid."

I have tried the following two lines of code:

Task.Stop = CurrentProj.StatusDate

and

Task.SetField FieldID:=pjTaskStop, Value:=CurrentProj.StatusDate

Current values are:

CurrentProj.StatusDate = 10/31/2013 17:00:00  
Task.Stop = 11/5/2013 17:00:00 

both are of Variant/Date DataType

I could not find and use of the Stop field in any forums. Thanks for any help you can provide.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Doug Clarke
  • 43
  • 1
  • 13
  • I have now found out that the schedule my macro was trying to manipulate has the drop down greyed out on the stop field. I'm looking to see if there is a setting which changes the stop field from read/write to read only – Doug Clarke Nov 19 '13 at 16:11

1 Answers1

0

The "Split in Progress Tasks" option must be selected or the Stop field will be read only. File>Options>Schedule>Scheduling options for this project>Split in progress tasks. Checking that box solved the problem.

Doug Clarke
  • 43
  • 1
  • 13