We are moving from 32-bit to 64-bit Office products. This means that some of the VBA code throws errors if the function is not declared PtrSafe
. I understand that I
PtrSafe
does not introduce any functionality. You cannot therefore say that something will or will not without it.
PtrSafe
is a flag with which you tell to the compiler, "I have verified that types I used for this API declaration are correct regardless of the pointer size".
If you have verified that the types you are using are correct, put the PtrSafe
. If you haven't, don't put it (and then it will not compile when there is a possibility of an error, that is, when the pointer size is not 32 bits).