#1
|
|||
|
|||
Setting an Assignment Field from VBA
I'm an MS Project tyro who just got thrown into working with a Project file (created by someone not currently available) that doesn't seem to be working as it should.
The setup is this: a Cost1 column has been added to the Task view, the value of which is calculated by VBA code in the project's Calculate event and then assigned to the field: Code:
Private Sub Project_Calculate(ByValpj As Project) Dim tskT As Task Dim asnA As Assignment 100 For Each tskT In ActiveProject.Tasks 110 If Not (tskT Is Nothing) Then 120 For Each asnA In tskT.Assignments 130 asnA.Cost1 = (asnA.Work / 60) * OtherRate The Cost1 column is set so: Custom attributes is None; Calculations for task and group summary rows is Rollup (sum); Calculations for assignment rows is None; Values to display is None. The problem is, the Cost1 cell for every assignment row shows zero, even when it shouldn't. The Cost1 cells for the task and group summary rows arenon-zero, and when I use a break to look into the code it shows the current Cost1 cell has having a non-zero value (using the handy ? asnA.Cost1 command in the Immediate pane); moreover, the value is what is expected from the calculation using the current values for Work and OtherRate. How do I get the assignment Cost1 fields to display the value assigned to them? Is there a setting I have to change? Addendum: it's MS Office Project 2007, if that matters (like I said, I'm a veritable sugarfoot where Project is concerned) Last edited by CGM3; 09-28-2010 at 12:43 PM. Reason: Add what I forgot |
#2
|
|||
|
|||
For some reason, this problem has vanished, and the fields are showing the data set into them.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to refer a field in another field | DaveSmith | Word | 0 | 08-24-2010 06:44 PM |
Help needed with assignment | ccmystery | Outlook | 0 | 04-09-2010 05:59 AM |
tafe assignment | alharris | Word | 0 | 11-16-2009 12:00 AM |
Can I get some help setting this up please? | Moiraes Fate | Office | 0 | 05-18-2007 12:22 PM |
setting rules | isapaine | Misc | 0 | 01-11-2006 07:51 AM |