Skip to content

MS Project color rolled up taskbar

Forum GuestMember for 17 years 8 months
Created
2
5
0
Hi, does anybody know how you can change the bar color of an individual rolled up task by means of VB?

More specific: Suppose you have two tasks after each other rolled up to a main task. The main task will now show 2 bars on the same line. How can the color of one of these bars be changed? (It can be done manually!)

To change the bar color of a normal task, I use code like this:
activeproject.Tasks.Application.GanttBarFormat(taskid:=4,middlecolor:=pjgreen)

2 replies

Oldest first
  1. 0
    Forum Guest ·
    (solution provided by Gérard Ducouret)

    Refer to the subtask with this code:

    GanttBarFormat TaskId:=x,GanttStyle:=y, MiddleColor:=z

    x=TaskID
    y=style number of the rolled up bar (see bar styles: default = 5)
    z=predefined color (e.g. pjGreen)
  2. 0
    Renaud Moisan ·
    Sorry for unearthing this topic :)

    Using VBA, I am looking for a way to copy a bar attribute (color, style, ...) to another bar.

    Searching the web I found how to assign a format to a bar using ganttbarformat. But I cannot find a way to get the format values of a given bar... Anybody can help?

Log in or join to reply

ProjectControls.com is free to join. Members can post questions, reply, vote and follow discussions.

Existing members: your original username and password still work. Forgot password?