In answer to the previous point about conditional compilation, there are almost no occasions when using #If Win64 is required
A better alternative is:
Code:
#If VBA7 Then
'for use with A2010 or later whether 32-bit or 64-bit
'use PtrSafe with all declarations and LongPtr for pointers/handles such as hwnd
#Else
'for use with A2007 or earlier
'normal API declarations with no PtrSafe or LongPtr
#End if
I disagree with Daniel Pineault.
There is absolutely no need to use #If VBA7 And Win64 Then ...
However if all users are running A2010 or later, they will have VBA7 so the conditional compilation is superfluous.
Just use the modified APIs with PtrSafe and LongPtr (where necessary)
Hope that helps