Alors, j'ai modifié le code :
#If Not VBA7 Then
Declare PtrSafe Function GetWindowTextLength Lib "USER32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Declare PtrSafe Function GetWindowText Lib "USER32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare PtrSafe Function EnumWindows Lib "USER32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Private Declare PtrSafe Function IsWindowVisible Lib "USER32" (ByVal hwnd As Long) As Long
#Else
Declare PtrSafe Function GetWindowTextLength Lib "USER32" Alias "GetWindowTextLengthA" (ByVal hwnd As LongPtr) As Long
Declare PtrSafe Function GetWindowText Lib "USER32" Alias "GetWindowTextA" (ByVal hwnd As LongPtr, ByVal lpString As String, ByVal cch As Long) As Long
Declare PtrSafe Function EnumWindows Lib "USER32" (ByVal lpEnumFunc As LongPtr, ByVal lParam As LongPtr) As Long
Declare PtrSafe Function IsWindowVisible Lib "USER32" (ByVal hwnd As LongPtr) As Boolean
#End If
Là ce n'est plus rouge et il ne me met plus le message d'erreur. Mais du coup il n'est plus en 32bits...
Lorsque je clic sur le bouton "TESTER LE VERSION VBA" il me met le msgbox "VBA7 is not ok"
Que je remplace VBA7 par Win64 c'est la même chose il me met toujours ce message.
Si je clic sur les autres bouton
j'ai une erreur ici:
AddressOf EnumWindowsProc, 0
Pour ce code :
Sub ListAppli()
Application.ScreenUpdating = False
[A1].CurrentRegion.Offset(1, 0).ClearContents
EnumWindows AddressOf EnumWindowsProc, 0
Cells.Columns.AutoFit
Application.ScreenUpdating = True
End Sub