RGB Function May Map to Incorrect Color (170781)
The information in this article applies to:
- Microsoft Excel 97 for Windows
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 5.0
This article was previously published under Q170781 SUMMARY
When you use the RGB function in a Visual Basic for Applications macro, the
color value of the RGB color of the index may be mapped to a color other
than the color you expected.
For example, RGB(65,0,0) is mapped to Dark Red, but RGB(64,0,0) is mapped
to Black.
The color property accepts an RGB triple and maps it to the nearest color
index. When the property retrieves the color value, it returns the RGB
color of the index, which may be different from the value you typed. In the
example, RGB(65,0,0) is mapped to Dark Red (RGB(128,0,0)), but RGB(64,0,0)
is mapped to Black (RGB(0,0,0)).
REFERENCES
For more information about the ShapeRange Object collection, click the
Index tab in Microsoft Visual Basic Help, type the following text
and then double-click the selected text to go to the "ShapeRange Object
Collection" topic. If you are unable to find the information you need, ask
the Office Assistant.
| Modification Type: | Minor | Last Reviewed: | 8/17/2005 |
|---|
| Keywords: | kbdtacode kbprb kbProgramming KB170781 |
|---|
|