Thanks Jack. I have now done lots of testing using different data types and
methods. It still fails.
Also reading the Assignment data fails, after the first attempt on assigning
Assignment data as I described. Same is using the global assign method as
described in Rod Gills book at the bottom of page 159.
When I say "fail" there is no error message generated, and it is not a
special value that generated the failure. It is simply assigning data to one
Custom field that seam to initiate the failure. Assignment goes "fine" in
that it can be read with the opposite command. But when you look in View >
Resource Usage and look at Cost1, it is disconnected to VBA after you VBA has
assigned an Assignment Custom field.
Reproducing this can be done as follows:
1) Open a new project (mpp)
2) Make one Task, and assign one resource
3) In View > Resource Usage insert Unique ID and Cost1, and enter 1234 in
Cost1
4) In VBA run debug.print
ActiveProject.Tasks.UniqueID(1).Assignments.UniqueID(AssignmentUid).Cost1 '
where AssignmentUid is taken from Resource Usage View
6) This displays 1234 as it should
7) In VBA run
ActiveProject.Tasks.UniqueID(1).Assignments.UniqueID(AssignmentUid).Cost1 =
CCur(5678)
8) Re-run 4 above, and it will display 5678 (as expected)
9) Look at the View > Resource Usage Cost1 is still 1234, not 5678 as expected
10) Enter 444 in View > Resource Usage Cost1 manually
11) Re-run 4 above. It will display 5678 as assigned in 7 above, and not 444
as it should.
So after stop 7 above, the new project is in a state (also after save +
open) where VBA and View > Resource Usage is disconnected.
Please help,
SteDal.