View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
[email protected] csugden@gmail.com is offline
external usenet poster
 
Posts: 15
Default VBA color picker - copy of Font dialog combo box

Thanks for both of those suggestions. I had seen John W's colour picker
and that's probably what I would call "Plan B". It'd do the job, but
not in the way I'd like. (I know, I'm fussy!)

As for the Common Dialogs, that's something I didn't know about.
Unfortunately this is going to be a downloadable workbook, so I need to
make sure it is widely supported. But it's definitely an avenue for me
to look down. Thanks very much.

Cheers,

Chris

On Nov 25, 1:48 am, "Robin Hammond"
wrote:
Chris,

Using the Microsoft Common Dialog controls you can get something close. The
drawback is that they need to be installed on target machines.

e.g.
Sub GetColour
CommonDialog1.ShowColor
If Err Then Exit Sub
msgbox CommonDialog1.Color
end sub

Robin Hammondwww.enhanceddatasystems.com

wrote in glegroups.com...

Thanks J. That's close, but not close enough really. I'd rather code up
my own colour picker than use a dialog that appears to have a function
(i.e. colouring cells) which is not what my users would be choosing the
colour for. Just wondering if there was some way of accessing the one
used in the Font dialog, as that's perfect. All I've found so far are
copies of that written in C, which I'm afraid I don't know how to
implement.


Chris


On Nov 24, 5:22 pm, "WhytheQ" wrote:
this is close enough isn't it:


Application.Dialogs(xlDialogPatterns).Show


Rgds
J


On Nov 24, 5:06 pm, wrote:


Hi,


I've had a look at a lot of color picking code for userforms, but I was
wondering if there was any way of just producing the same combo box
that can be found in Format--Cells--Font (I'm using Excel).


I've looked at various application.dialogs, but they would confuse my
users - all I need is the colour, and the way it is done in the Font
page seems ideal.


Either an inbuilt solution (i.e. something within excel that I can
reference, like a dialog) or a copy would be fine. Anyone seen anything
like this?


Thanks very much,


Chris