Hello ronjon65,

Windows Vista, 7, 8, and 10 support 32 and 64 bit programs. The 32-bit and 64-bit versions of Office programs aren’t compatible, so you can’t install both on the same computer.

Office 2010 introduced a new version of VBA known as VBA 7.0. This works with both 32 and 64 bit machines. There is compilation constant VBA7 used to test for this new version.

Here are the 32 and 64 bit versions of the two API calls you are using. The 64 bit API will only work if the 32 bit DLL is loaded on the 64 bit machine.
This macro will load the correct API calls for machines using 64 bits and VBA 7.0 using conditional compilation statements.

#IF VBA7 = True Then
    ' 32 Bit API
    Private Declare PtrSafe Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As LongPtr
    Private Declare PtrSafe Function GetExitCodeProcess Lib "kernel32" Alias "GetExitCodeProcess" (ByVal hProcess As LongPtr, lpExitCode As Long) As Long 
#ELSE 
    ' 64 bit API 
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long      Private Declare Function 
    GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long 
#End If