RGB fill color not right

L

Lucky

Excel 2003. I'm using VBA's graphics methods to draw a large area on
the screen that is not exactly square. I then fill this area with a
solid RGB color. No pattern or transparency or anything, just a solid
beige color. Sometimes the area appears with the color I want, and
sometimes it's way too light, almost white. I can't figure out how to
fix this. Any ideas?
 
T

Tim Williams

XL2003 has a limited color palette (56 distinct color slots I think) - if
you specifiy a color which isn't on the palette Excel will "automagically"
map it to the nearest palette color.

Only way around this is if you know up-front which exact colors you need:
then you can modify the workbook's color palette to make sure it includes
them.

Tim
 
P

Peter T

Sounds like you have drawn a Freeform, or some Shape at least. Unlike cells
and charts (in Excel 2003 and earlier) Shapes can be formatted to accept any
RGB colour, eg

Dim shp As Shape
Set shp = ActiveSheet.Shapes("Freeform 1") ' < change name
shp.Fill.ForeColor.RGB = RGB(25, 150, 225)
' unlikely to need the following but just in case
shp.Fill.Solid
shp.Fill.Transparency = 0
shp.ThreeD.Visible = msoFalse

Regards,
Peter T
 
L

Lucky

Just to follow this up, I had added a smaller area within an adjoining
area that was white. Changing the color of the smaller area to beige
like the big area somehow fixed the problem. I don't quite understand
what happened, but thought I'd add this in for the benefit of others
who might experience a similar problem. Anyway, thanks to those who
replied.
Lucky
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top