View Single Post
  #11   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

It's looking like I will be writing my own after all. Ah well, learning
by doing. I'll use a few examples to work from, including j-walk's (as
soon as I get to a windows computer so I can run his .exe downloads!)

I was a little confused by your message, Peter. If adjusting j-walk's
colour picker won't take much coding, what is it that will involve a
lot of code? It is to apply format, yes, in that my program will store
a background colour for cells and two different foreground colours for
different kinds of output.

Cheers,

Chris

On Nov 25, 3:06 pm, "Peter T" <peter_t@discussions wrote:
Why not indeed have a go at writing your own. I have a soft spot for
j-walk's color picker which can be adapted to look very similar to Excel's
drop down palette, colours correctly arranged and with all colour controls
added at runtime (ie small *frx size). It's minimal code to do that.

However, and another subject, if it's to be used to apply colour format to
any type of selection, and to whatever fill font border, will involve a
tremendous amount of code (I've done it!).

Regards,
Peter T

wrote in oglegroups.com...

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 listboxexample.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 ooglegroups.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