vba declare api 64 bit 32 bit

The solution for “vba declare api 64 bit 32 bit” can be found here. The following code will assist you in solving the problem.

‘ At the top of your module: works for both 32 and 64 bits
#If VBA7 Then
Public Declare PtrSafe Function GetVersionExA _ ‘ 64 bits
Lib “kernel32” (lpVersionInformation As OSVERSIONINFO) As Integer
#Else
Public Declare Function GetVersionExA _ ‘ 32 bits
Lib “kernel32” (lpVersionInformation As OSVERSIONINFO) As Integer
#End If

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts