Compatibilité excel 2007 et 2010 code vba
Bonsoir,
Il y de cela un bon moment, j'avais trouvé dans la faq un code que je n'arrive plus à retrouver (juste pour mettre le lien).
Le code en question permet de retirer de la barre de titre d'une userform les icônes réduire/ajuster/fermer.
Sous excel 2007, c'est impeccable mais ne fonctionne pas sous excel 2010.
J'ai bien trouvé quelques codes que je n'arrive pas à adapter ou ne sont pas applicables à mon cas.
Voici le code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Private Declare Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLongA Lib "user32" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib "user32" _
(ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Sub UserForm_Initialize()
Dim hwnd As Long
hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", _
"X", "D") & "Frame", Me.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And &HFFF7FFFF
End Sub |
En vous remerciant par avance.
Bon week-end.