32 - 64

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

32 - 64

Post by LisaGreen »

Hi,

There is 32 bit and 64 bit and vba7 and vba6.5.
Put simply, because of the length of the win64 bit variables, vba works as in the following table.
Can anyone confirm this please.

Win32 win64

VBA6.5 Declare Declare <PtrSafe>
Can't use PtrSafe Can Use PtrSafe


VBA7 Declare <PtrSafe> Declare PtrSafe
Can Use PtrSafe Can only use PtrSafe


TIA
Lisa

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: 32 - 64

Post by HansV »

All versions of Office starting with Office 2010 have VBA 7.
So you'd only need to take VBA 6.5 into account if you need to support Office 2007, which was released more than 16 years ago.
Otherwise, use PtrSafe - it'll work in both 32-bit and 64-bit versions of Office 2010, 2013, 2016, 2019, 2021 and Microsoft 365.
Best wishes,
Hans