Read this to feel PtrSafe about Office 64 Bit compatibility

<< Click to Display Table of Contents >>

Navigation:  VBA >

Read this to feel PtrSafe about Office 64 Bit compatibility

If you write Microsoft Access databases with basic VBA code and no fancy Windows calls, you will find your database will run with Office 32 bit and Office 64 bit with no problems. But if you have used fancy windows library calls, you are likely to get this bug
 
Compile error
The code in this project must be updated for use on 64-bit Visual Basic VBA7. Please review and update Declare statements and then mark them with the PrtSafe attribute.
 
 
This issue is discussed in detail here at Microsoft and here and Conditional Compilation is discussed here

 

Better still, here is some code that now works with both Office 32 bit and Office 64 bit VBA

 

 

'Office 64 Bit Code - Conditional Compile
 
#If VBA7 Then
'64 Bit code
 
Public Declare PtrSafe Function etc etc
#Else
'32 Bit code

 
Public Declare Function etc etc
#End If

 

201407_gr1