Hello All,
A few years ago I switched to 64 bit Office. I am now revisiting some code that was written with a 32 bit version. I received an error re: compatibility.
I found that I can resolve this issue for my 64 bit code by converting the declaration to 'PtrSafe' as follows:
This works fine. However, I have read that I should be able to add:
This supposedly should direct the compiler to select the correct declaration and proceed. However, the 32 bit declaration is picked up at compile and it will not run. Any insights?
Thank you,
David
A few years ago I switched to 64 bit Office. I am now revisiting some code that was written with a 32 bit version. I received an error re: compatibility.
I found that I can resolve this issue for my 64 bit code by converting the declaration to 'PtrSafe' as follows:
VBA Code:
#If VBA7 Then
Private Declare PtrSafe Function InternetGetConnectedStateEx Lib "wininet.dll" (ByRef lpdwFlags As LongPtr, ByVal lpszConnectionName As String, ByVal dwNameLen As Integer, _
ByVal dwReserved As LongPtr) As LongPtr
VBA Code:
#Else
...32 bit Declaration...
#End If
Thank you,
David