Link to home
Start Free TrialLog in
Avatar of abfinfo
abfinfo

asked on

Differentiation VBA 32bit/64bit for declare statements

I've got the following code which is incompatible with Winword 2010 64bit:

Declare Function GetPrivateProfileString32 Lib "KERNEL32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer

Open in new window


I know for "normal stuff" it's possible to differentiate in the following way:

If Mid(Application.ProductCode,21,1)=0 then
   ’32 bit
Else
   ’64 bit
End If

Open in new window


Is it possible to do this for declare statements too? I my case it isn't possible to use two different versions, one for 32 bit and one for 64. What's the best solution for this problem? Please post some code..
Avatar of Bill Prew
Bill Prew

ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial