Howdy craigg3,
As I understand it, you can't return meaningful index numbers from the dialog, but have a play with the following:<pre>
Private Declare Function ChooseColor Lib "comdlg32.dll" Alias _
"ChooseColorA" (pChoosecolor As ChooseColor) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Type ChooseColor
lStructSize As Long
hwndOwner As Long
hInstance As Long
rgbResult As Long
lpCustColors As String
flags As Long
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Private Function ShowColor() As Long
Dim ChooseColorStructure As ChooseColor
Dim Custcolor(16) As Long
Dim lReturn As Long
ChooseColorStructure.lStructSize = Len(ChooseColorStructure)
ChooseColorStructure.hwndOwner = FindWindow("XLMAIN", _
Application.Caption)
ChooseColorStructure.hInstance = 0
ChooseColorStructure.lpCustColors = StrConv(CustomColors, _
vbUnicode)
ChooseColorStructure.flags = 0
If ChooseColor(ChooseColorStructure)<> 0 Then
ShowColor = ChooseColorStructure.rgbResult
CustomColors = StrConv(ChooseColorStructure.lpCustColors, _
vbFromUnicode)
Else
ShowColor = -1
End If
End Function
Sub ColorTime()
Selection.Interior.Color = ShowColor
End Sub</pre>
From
here. Utilizes the Windows palette. Hope this helps.
_________________
Cheers,<font size=+2><font color="red">
Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2003-01-16 18:52