#If VBA7 And Win64 Then
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal ms As LongPtr)
Private Declare PtrSafe Function FindWindow Lib "USER32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare PtrSafe Function GetWindow Lib "USER32" ( _
ByVal hWnd As LongPtr, _
ByVal wCmd As Long) As LongPtr
Private Declare PtrSafe Function SetForegroundWindow Lib "USER32" ( _
ByVal hWnd As LongPtr) As Long
#Else
Private Declare Sub Sleep Lib "kernel32" (ByVal ms As Long)
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String)
As Long
Private Declare Function GetWindow Lib "user32" _
(ByVal hwnd As Long, ByVal wCmd As Long) _
As Long
Private Declare Function SetForegroundWindow Lib "user32"
(ByVal hwnd As Long) As Long
#End If
Sub Test()