View Single Post
  #8   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 Andy. If I end up having to write my own, that will definitely
help.

I've been looking through Common Dialog resources, and was wondering if
anyone knew the answer to this: if I am distributing an excel file
(with vba code), does that mean that the required .dll file (required
for the Common Dialogs) will be on the user's computer, because they
must have Office installed? In other words, is the warning to
developers that the .dll must be distributed with the program only
relevant for those making standalone VB applications, because the user
might not have Office and hence not the .dll?

It's just a hunch that the common dialogs would automatically be
available wherever Office is installed, but it seems probable (given
the name!).

If I can be sure the common dialogs will work whenever a copy of Excel
is being used, then that fits the bill perfectly. Anyone have an answer
to this question?

Cheers,

Chris

On Nov 25, 11:15 am, Andy Pope wrote:
Hi,

You might be able to re work this dropdown listbox example.http://www.andypope.info/vba/colourdropdown.htm

Cheers
Andy

wrote:
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