Forum Discussion

sivanr's avatar
sivanr
Copper Contributor
Sep 02, 2021

I can't seem to assign a value to Duration field in MSProject by using VBA

I can't seem to assign a value to Duration field in MSProject by using VBA. Probably has something to do with types? Tsk.Duration = (rate1) --while rate 1 is defined as long and equals 14

the value that appears is 0.03 (in days). Why not 14 days??? Tsk.Duration is Variant/Long

Thanks in advance,!

  • John-project's avatar
    John-project
    Silver Contributor
    sivanr,
    Because all time related values in Project are in minutes so when you have a value of 14, it is treated as 14 minutes which is 0.03 days, based on the Standard calendar and the definition for a day (i.e. 480 minutes)
    Hope this helps
    John

Resources