继续这个问题:How to convert 32 bit VBA code into 64 bit VBA code,我编写了以下vba访问代码:
#If VBA7 Then
Private Declare PtrSafe Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
#Else
'The folowing line is ilegal in Access 2019:
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
#End If
此代码在Access 2013上运行良好,但在Access 2019上失败。其他情况在2019年是非法的。怎么了?
VBA7对于Access 2007及更高版本为True,因此Else部分将永远不会在较新的Access中运行。
您将需要Access 2003或更早版本才能签出Else
部分。