Declare PtrSafe Compatibility in Excel

后端 未结 1 1021
终归单人心
终归单人心 2020-12-02 01:00

I am using this statement in VBA

Private Declare PtrSafe Function GetTimeZoneInformationAny Lib \"kernel32\" Alias _
  \"GetTimeZoneInformation\" (buffer As          


        
相关标签:
1条回答
  • 2020-12-02 01:16

    ok I have re-written this like:

    #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
    

    This gave a compile error on the second line in Excel 2010 64-bit and the line remained colored red but when I compile again the error doesn't show up anymore. Is this how Excel behaves?

    0 讨论(0)
提交回复
热议问题