

VBA now includes the variable type alias LongPtr. Three important additions are the LongPtr type alias, the LongLong data type, and the PtrSafe keyword. The table at the bottom of this document summarizes the new VBA language features. To address this problem and enable VBA code to work correctly in both 32-bit and 64-bit environments, several language features have been added to VBA. This can result in memory overruns, unexpected results in your code, and possible application failure.

The problem with running legacy VBA code in 64-bit Office is that trying to load 64-bits into a 32-bit data type truncates the 64-bit quantity.

You only need to modify VBA code if it runs in the 64-bit version of Microsoft Office.
