我在VBA中使用这个语句
Private Declare PtrSafe Function GetTimeZoneInformationAny Lib "kernel32" Alias _
"GetTimeZoneInformation" (buffer As Any) As Long
这适用于:
- Win 64 位、Excel 2010 64 位
- Win 64 位、Excel 1010 32 位
然而我的客户报告了这个词的编译错误PtrSafe
。他正在使用 Excel 2010。
我不知道为什么会发生这种情况。有任何想法吗?
好的,我已经重写了这个:
#If VBA7 Then
Private Declare PtrSafe Function GetTimeZoneInformationAny Lib "kernel32" Alias "GetTimeZoneInformation" (buffer As Any) As Long
#Else
Private Declare Function GetTimeZoneInformationAny Lib "kernel32" Alias "GetTimeZoneInformation" (buffer As Any) As Long
#End If
这在 Excel 2010 64 位中的第二行上产生了编译错误,并且该行保持红色,但当我再次编译时,错误不再显示。这是 Excel 的行为方式吗?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)