What issue I'm facing is, I want to distribute one of my Excel VBA Template. Almost in all procedure, I have assigned LONG datatype. but, I found that for VBA7 or 2010 and later version, we can use LongPtr datatype for assigning. which will bypass the versioning issue. whether it will be a 64bit or 32bit of MS office.
But one my mate has pointed out I can't use LongPtr for VB6 or for lower of 2010 office.
So I have tried to use in the way to make it more usable for any office version
#If VBA7 Then
Dim X As LongPtr
#Else
Dim X As Long
#End If
Should I use above declaration? Will it cause the error? According to my friend, It will cause. He also added that compiler will bypass the if statement.
I don't have a system to test it.
My current system is,
Windows 10 64bit
MS Office 2016 32bit
Please suggest me, where I'm missing the concept. And Why I can't use the above declaration in procedure?
Thank you.