Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile error on Office 365 desktop in 64 bit

Status
Not open for further replies.

Fino

IS-IT--Management
May 13, 2007
14
US
I have an access database that has worked for years with no problem. The windows 10 system is running Office 365 on the desktop. The PC is 64 bit.

I just built a new PC that is windows 10 and I downloaded Office 365 from one of the allowed family subscriptions
Capture_donplj.png
. When I try to run the access application it blows up with a compile error. I think the version for Office on the new build is 64bit and therefore causing problems.

Can anyone please help me with this compile error? I have no idea what PtrSafe attribute means. Do I have to uninstall Office and download a 32-bit version if that is still available for download?


Code:
'Windows API functions and constants to work with the Registry
Private Const REG_SZ As Long = 1
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Const HKEY_CURRENT_USER = &H80000001
Private Const KEY_ALL_ACCESS = &H3F

[highlight ]'The three Private Declare Functions show as red.[/highlight]


Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias _
           "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, _
           ByVal ulOptions As Long, ByVal samDesired As Long, phkResult _
           As Long) As Long
Private Declare Function RegQueryValueExString Lib "advapi32.dll" Alias _
          "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As _
           String, ByVal lpReserved As Long, lpType As Long, ByVal lpData _
          As String, lpcbData As Long) As Long
Private Declare Function RegQueryValueExNULL Lib "advapi32.dll" Alias _
          "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As _
          String, ByVal lpReserved As Long, lpType As Long, ByVal lpData _
          As Long, lpcbData As Long) As Long

Global Channum As Long, App As String, Obj As String
Global FileStr As String, BadgeTitle As String
 
 https://files.engineering.com/getfile.aspx?folder=41dc42a0-fffc-41b0-ad02-2cf4827e37fc&file=Capture.PNG
Never Mind.
I decided to uninstall Office 64 bit and install Office 32 bit. Everything is working as it should. I have no idea why the code would be different between the two. All I know is that with Office 64-bit installed my programs blew up and they work fine in the 32-bit version. Lesson learned.
 
A quick Google search on "Function RegOpenKeyEx Lib" gave me this link: RegOpenKeyEx for 32 and 64 bit
It may be a solution to your issue in a 64-bit world...

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Interesting read. Thanks so much for sending it. For now, I am going to leave well enough alone!
Thanks for the info.
 
Sooner or later you may not have a choice of 32 vs 64 bit 'world'. So, consider to move on anyway to 64 bit environment. Especially when you app can 'detect' which one to use.

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
You may be correct. However, I am 70 and won't be doing much VBA in the future.pipe
 
To somewhat answer the question...
Yes API calls for 64 bit are a hassle... If you were to search around I have seen entire lists of ways to declare api calls for 64 and 32 bit. Becomes an issue if you have to support systems older than VBA 7 and then you need a compiler directive but I doubt many are in that situation now.

Some 32 bit products prevented my organization from going 64 bit... I thought we were going to have to. I think we caught our calls for them not to be an issue aside from the Fax product that is going away now.

365 is a total hassle in my opinion. Just errors and corrupts to often. I backing up more often may be a good idea. Then again I do things with Access no one ever intended and they may have something to do with it.
 
Thank you for your input lameid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top