Yogesh
Yogesh

Reputation: 1216

MS Project 2010 - Change the value of enterprise custom field

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

Upvotes: 0

Views: 2386

Answers (1)

Rachel Hettinger
Rachel Hettinger

Reputation: 8442

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

Upvotes: 1

Related Questions