VBA code for setting Income value

D
Dariusz C 👤 Member for 7 years 5 months

Hi experts

I'm writing macro for Asta and hit the wall when I want to assign income value in task.

Below code finds Income Cost Centre assigned, but can't find a way to set value.

Dim t As TaskBase

Dim bcv As BarChartView

Dim ca As CostAllocation

 Set bcv = ap.CurrentView

 AllTasks = bcv.AllTaskBaseIds

  For Each act In AllTasks    

     For i = 1 To t.Allocations.Count

             Set ca = t.Allocations(i)

         'here I need to set income value on this task 

      Next i

 Next act





Thank you in advance for any hints!

D
Dariusz C 👤 Member for 7 years 5 months

It wasn't work with ca.Value.

I found that work like below:

The missing code is:

ca.GivenValue = 100 ' or whatever you need

Topic closed :)

Forum Sponsor

Top Posters

Julian Pegg
1 posts
Peter Nagy
2 posts
Raymund de Laza
17 posts
Syed_Asad
0 posts
Tony Greyvenstein
0 posts
Ahmed Al-Jubouri
13 posts
Umar Alvi
3 posts
Sibusiso Mahlalela
0 posts
Michael Samanyayi
3 posts
Simon Gumede
0 posts