#1   Report Post  
Bill Martin
 
Posts: n/a
Default ColorConstants

Searching through the Excel97 VBA Help system for something else, I came across
the entry for ColorConstants. It says:

The ColorConstants module contains predefined color constants.
These constants can be used anywhere in your code.

This sounds useful to me, but where in heck does one find the "ColorConstants
module"? It doesn't seem to automatically appear anywhere and doing a search of
my entire disk for some file of that name returns nothing. Also searching the
Microsoft website for "Colorconstants" returns nothing.

I have stumbled into the fact that I can use ColorConstants.vbMagenta for
example to set a color, but the drop down list only shows 8 "vb" colors.

Bill
  #2   Report Post  
Juan Pablo González
 
Posts: n/a
Default

My understanding is that this enumeration is different than the 56 color
palette that Excel uses. Their RGB representation ends up being the same
(for the 8 colors that are available as a constant), but it's not the same
thing.

I guess another reason is that you can customize the color palette in Excel,
so that ColorIndex 1 is now something completely different than the
"standard" one. Then, any "builtin" constant that said that ColorIndex 1
was, say, red, would be wrong.

--
Regards,

Juan Pablo González
Excel MVP

"Bill Martin" wrote in message
...
Searching through the Excel97 VBA Help system for something else, I came
across the entry for ColorConstants. It says:

The ColorConstants module contains predefined color constants.
These constants can be used anywhere in your code.

This sounds useful to me, but where in heck does one find the
"ColorConstants module"? It doesn't seem to automatically appear anywhere
and doing a search of my entire disk for some file of that name returns
nothing. Also searching the Microsoft website for "Colorconstants"
returns nothing.

I have stumbled into the fact that I can use ColorConstants.vbMagenta for
example to set a color, but the drop down list only shows 8 "vb" colors.

Bill



  #3   Report Post  
George Nicholson
 
Posts: n/a
Default

There is also a set of constants for the settings governed by the windows
color pallete: i.e., a constant that translates to the "window caption bar
backcolor/forecolor", "disabled control backcolor/Forecolor", " tooltips
backcolor/forecolor", etc. The idea being that you could use the "Disabled
textbox backcolor" constant in code/property settings and you will get
whatever color the user's window palette calls for: grey, red, etc.

I have a hardcopy of this list somewhere (circa 97, several dozen items) but
when I've tried to find it again on MSKB, I never could....

Not much help, I know...
--
George Nicholson

Remove 'Junk' from return address.


"Juan Pablo González" wrote in message
...
My understanding is that this enumeration is different than the 56 color
palette that Excel uses. Their RGB representation ends up being the same
(for the 8 colors that are available as a constant), but it's not the same
thing.

I guess another reason is that you can customize the color palette in
Excel, so that ColorIndex 1 is now something completely different than the
"standard" one. Then, any "builtin" constant that said that ColorIndex 1
was, say, red, would be wrong.

--
Regards,

Juan Pablo González
Excel MVP

"Bill Martin" wrote in message
...
Searching through the Excel97 VBA Help system for something else, I came
across the entry for ColorConstants. It says:

The ColorConstants module contains predefined color constants.
These constants can be used anywhere in your code.

This sounds useful to me, but where in heck does one find the
"ColorConstants module"? It doesn't seem to automatically appear
anywhere and doing a search of my entire disk for some file of that name
returns nothing. Also searching the Microsoft website for
"Colorconstants" returns nothing.

I have stumbled into the fact that I can use ColorConstants.vbMagenta for
example to set a color, but the drop down list only shows 8 "vb" colors.

Bill





  #4   Report Post  
Bill Martin
 
Posts: n/a
Default

George Nicholson wrote:
There is also a set of constants for the settings governed by the windows
color pallete: i.e., a constant that translates to the "window caption bar
backcolor/forecolor", "disabled control backcolor/Forecolor", " tooltips
backcolor/forecolor", etc. The idea being that you could use the "Disabled
textbox backcolor" constant in code/property settings and you will get
whatever color the user's window palette calls for: grey, red, etc.

I have a hardcopy of this list somewhere (circa 97, several dozen items) but
when I've tried to find it again on MSKB, I never could....

Not much help, I know...


--------------------------------

What I started out looking for was some kind of listing of colors translated
into either the R,G,B values or into the LONG equivalent VBA uses:

ColorValue = RGB(r,g,b)

I would have thought that dead easy to find somewhere, but I haven't had much
luck searching the web thus far.

Bill
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"