none
How to use RGB in GanttBarStyleEdit? RRS feed

  • Question

  • I use a script based on GanttBarEditSyle to set up standard bar styles.  The problem is that this apears to be limited to the 16 basic pjColor colors.  But if I use the menu, I can assign any RGB color.  Is there any way to change the bar color in VBA to any RGB value??
    Wednesday, November 26, 2014 11:15 PM

Answers

  • jack n birkdale,

    Sure, use the RGB function to define the various gantt bar item colors. For example, the following will format the first bar style with a green start symbol, a red bar and a blue end symbol:

    GanttBarEditEx Item:="1", StartColor:= RGB(0, 255, 0)

    GanttBarEditEx Item:="1", MiddleColor:=RGB(0, 255, 0)

    GanttBarEditEx Item:="1", EndColor:=RGB(0, 0, 255)

    Hope this helps. If this answers your question, please mark it as the answer.

    John

    Thursday, November 27, 2014 2:11 AM

All replies

  • jack n birkdale,

    Sure, use the RGB function to define the various gantt bar item colors. For example, the following will format the first bar style with a green start symbol, a red bar and a blue end symbol:

    GanttBarEditEx Item:="1", StartColor:= RGB(0, 255, 0)

    GanttBarEditEx Item:="1", MiddleColor:=RGB(0, 255, 0)

    GanttBarEditEx Item:="1", EndColor:=RGB(0, 0, 255)

    Hope this helps. If this answers your question, please mark it as the answer.

    John

    Thursday, November 27, 2014 2:11 AM
  • Thank you, exactly.  Just use GanttBarEditEx instead of GanttBarEditStyle & use RGB instead of pjColor. 
    Thursday, November 27, 2014 3:33 AM
  • Jack n birkdale,

    You must be Toyota, because "you got it!"

    You're welcome and thanks for the feedback.

    John

    Thursday, November 27, 2014 4:39 PM