Hello cexarto,
Conditional Compilation of API functions can not be done inside a Sub or Function procedure. Your code should appear this way in the module...
#If Win64 Then
Private Declare PtrSafe Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As LongLong
Private Declare PtrSafe Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As LongLong
Private Declare PtrSafe Function GetCurrentThreadId Lib "kernel32" () As LongLong
#Else
Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32.dll" (ByVal hLibModule As Long) As Long
Private Declare Function GetCurrentThreadId Lib "kernel32.dll" () As Long
#End If
Bookmarks