How to fix a VBA “type mismatch” error after switching to 64-bit Excel
I updated the dll calls to use LongPtr everywhere instead of Long. You should have not done that. By adding PtrSafe to a function declaration, you promise to the compiler that you have put LongPtr in all places where it needs to be, and nowhere else. LongPtr is a pointer-sized integer. It must be used … Read more