我在VBA中使用此语句
Private Declare PtrSafe Function GetTimeZoneInformationAny Lib "kernel32" Alias _
"GetTimeZoneInformation" (buffer As Any) As Long
这适用于:
但是我的客户报告了单词PtrSafe
的编译错误。他正在使用Excel 2010。
我不确定为什么会这样。任何想法?
答案 0 :(得分:3)
好的我重写了这个:
#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的行为吗?