Solved

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

Posted on 2004-04-30
1
621 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now