salutàtous,
@Gilbert, est ce que c'est celle-ci que tu cherche ?
'=============================================================
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)
Debug.Print
ChooseColorStructure.lpTemplateName
Else
ShowColor = -1
End If
End Function
Sub ColorTime()
Selection.Interior.Color = ShowColor
End Sub
'=============================================================