0
votes

Looking for how to change/update values in enterprise custom fields using VBA in MSProject2010.

sofar i tried below snippet but with error : "application defined or object defined error"

    For Each prTask In prProject.Tasks
        prTask.SetField(FieldNameToFieldConstant("EntCustField"), "value") any
    Next

what i am doing wrong or any other way ?

Thanks

1

1 Answers

1
votes

Separating finding the field code from setting the value might help isolate the error:

Dim prTask As Task
Dim fldCode As Long
fldCode = FieldNameToFieldConstant("EntCustField")
For Each prTask In prProject.Tasks
    prTask.SetField fldCode, "value"
Next