Access 2016 VBA (1 Viewer)

alabad

New member
Local time
Today, 13:31
Joined
Jul 3, 2012
Messages
2
VBA issue: how to change reference from 32bit to 64 bit in access 2016 VBA? my Access file is 2016 32bit component of office 2016 32 bit, in Win 10 64 bit, then i removed office 32bit and installed office 64 bit this done by Microsoft technician staff, then when tried to open my access database file 32bit, i had a a VBA pop up message asking me to update the code in VBA from 32bit to 64bit. I attached 2 photo to help clarify my issue.
thanks
alabad
 

Attachments

  • access_32bit.JPG
    access_32bit.JPG
    67.9 KB · Views: 220
  • access2_32bit.JPG
    access2_32bit.JPG
    71.4 KB · Views: 210
Last edited:

sneuberg

AWF VIP
Local time
Today, 03:31
Joined
Oct 17, 2014
Messages
3,506
I'd reconsider the choice of 64 bit Office. This half explains what needs to be done to make the declare statements compatible. I say half because you also need to know the details of the API your are dealing with.

Unless you can't live without a 64 bit feature (e.g. big Excel Spreadsheets) I suggest installing the 32 bit version of Office. I think this thread demonstrates that getting these declarations right can be difficult and it appears that the AWF forum members have little experise in the area.
 
Last edited:

CJ_London

Super Moderator
Staff member
Local time
Today, 10:31
Joined
Feb 19, 2013
Messages
16,553
I agree with Sneuberg. Better to stick with 32bit office unless you need the additional processing power for Excel - i.e. spreadsheets with 500k+ rows.

the easy bit is to adding ptrsafe to the function declaration. The harder bit is knowing when to change longs to longlongs.

Simply you could just replace longs with longptr which will convert as required depending on the version of access, but it is better to only apply when required. You will also need to convert any dimmed variables where required as well. i.e. assigning an api function value which is long or longlong

This is quite a useful link and has further links to other resources

http://www.jkp-ads.com/articles/apideclarations.asp

Note that if you create a .accde then even with the changes made, a .accde created in 64bit access will only work on another 64bit office installation. Similarly a 32bit .accde will not run on a 64bit office application. And you cannot have both 32 and 64bit office on the same machine (not even if one of them is runtime).
 

static

Registered User.
Local time
Today, 10:31
Joined
Nov 2, 2015
Messages
823
You can replace those functions with environ.

Code:
Debug.Print Environ("username")
Debug.Print Environ("computername")
 

sneuberg

AWF VIP
Local time
Today, 03:31
Joined
Oct 17, 2014
Messages
3,506
You can replace those functions with environ.

Code:
Debug.Print Environ("username")
Debug.Print Environ("computername")

This web page seems to say that these are not safe especially with operating systems prior to Windows 7.
 

static

Registered User.
Local time
Today, 10:31
Joined
Nov 2, 2015
Messages
823
That web page seems to be related to linux.

Whatever, I've never heard anybody have trouble with it.
 

Users who are viewing this thread

Top Bottom