Solved

Problems with setting the color of the bar in an MSChart control

Posted on 2004-04-30
1
625 Views
Last Modified: 2013-12-26
Hi all,
I must be doing something very silly. I want to change the
color of the bar in an MSChart Control. I found (and pasted)
the code to do that from http://support.microsoft.com/default.aspx?scid=kb;en-us;177997

The resulting code is:
        ReDim arr(1 to 5, 1 To 2)
         For j = 1 To 5
            arr(j, 1) = j
            arr(j, 2) = j*100
        Next j
       
        With mschart1.Plot.SeriesCollection(1).DataPoints(-1)
            .Brush.Style = VtBrushStyleSolid
            .Brush.FillColor.Red = 255
            .Brush.FillColor.Green = 0
            .Brush.FillColor.Blue = 0
        End With
        mschart1.ChartData = arr()

But whatever the R,G,B combination I use, the bars are always green!!

(:confused)

Any clue? Thank you very much,

rr.



0
Comment
Question by:rrgw
1 Comment
 
LVL 7

Accepted Solution

by:
OHDev2004 earned 50 total points
ID: 10968504
instead of :
            .Brush.Style = VtBrushStyleSolid
            .Brush.FillColor.Red = 255
            .Brush.FillColor.Green = 0
            .Brush.FillColor.Blue = 0

Try this:
.Brush.FillColor.Set 255, 0, 0

OHDev2004
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question