How to access the 'color pick window'?

  • Thread starter Thread starter Jan Nordgreen
  • Start date Start date
J

Jan Nordgreen

I am using Excel 97.

I would like to know how to use programmatically the window that opens when
I click 'Fill Color' or 'Font Color' on the Format toolbar.

I need to know how to open it, and how it returns the color the user chose.

This gives a color window, but not the one I want:
Dim x As CommonDialog
Set x = New CommonDialog
x.ShowColor

Any ideas?

Sincerely,
Jan Nordgreen
 
application.Dialogs(xlDialogFontProperties).SHOW

application.Dialogs(xlDialogColorPalette).Show

are possibilities. Probably the second. The act the same as if you showed
them from the menu - they have a specific purpose and you can not use them
for any other. In otherwords, you can't use the second one for anything
other than setting the color to the selection - so the selection must be
something that will work with this dialog, or you get an error. the dialog
itself only returns true or false. False if the user clicks cancel, true
otherwise. If you want to know what color was selected, you will have to
examine the selected object.
 
Jan,

Here is another way to get a color pallet.
It appears that you can select cells while it is visible.
'---------------------------------------------
Sub ShowColorPallet
With Application.CommandBars("Fill Color")
.Top = 350
.Left = 500
.Visible = True
End With
End Sub
'------------------------------------------------
As Tom said, you will have to determine the color chosen by examining the
selection.

Regards,

Jim Cone
San Francisco, CA
************************************************
 
Back
Top