Compile error when you edit a VBA macro in the 64-bit version
Check VBA Version
#If VBA7 Then
Msgbox "64 bit Version"
#Else
msgbox "32 bit version
#End If
convert 32 bit VBA code into 64 bit VBA code
- Replace (
Long)
data type with (LongPtr)
at all places in the scripts
This is 64 bit code Private Declare Function GetVersionEx Lib "kernel32" _ Alias "GetVersionExA" (lpVersionInformation As _ OSVERSIONINFO) As Long
This is 64 bit code after conversion Private Declare PtrSafe Function GetVersionEx Lib "kernel32" _ Alias "GetVersionExA" (lpVersionInformation As _ OSVERSIONINFO) As Long