MS Access, Run-time error 48 Error Loading dll after upgrading from 2013 64-bit to 2016

I've developed a small Access database to generate reports in Excel for myself and co-worker.  I have code in an auto execute macro that is supposed to find any broken references, remove them, then add the Excel reference based on GUID.  I've been doing it this way because my co-worker still has Excel 2010 on his pc and we can't upgrade b/c he works for another contractor.  This worked fine until I upgraded to Office 2016.  Now I get a Run-time error 48: Error Loading DLL on line 3 every time I open the database.

Dim strGUID As String
strGUID = "{00020813-0000-0000-C000-000000000046}"
Access.References.AddFromGuid strGUID, 1, 0

Open in new window


The code above still works on the other pc.  I've done a little research and most things point to missing registry keys for  ACEDAO.DLL and dao360.dll but I've checked the registry and both those keys are present.  Has anyone ran into this issue before and is there a way of solving it without having to completely reinstall Office.
Bobby McKnightProject Controls Technical Specialist Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PatHartmanCommented:
The bit-version of Office is what is important.  A single database will not work for both the 32-bit version of Office and the 64-bit version without using conditional compilation.  Computers have been 64-bit for many years and so OS's have been also.  A 64-bit version of Office has been available also for many years but due to compatibility issues, MS still recommends that you NOT use the 64-bit version of office unless you have some particular need to support humongous worksheets.  Once you determine that you need 64-bit Excel, all of Office must be 64-bit.  You can't mix and match.

To solve your problem, you might be able to use conditional compilation to switch between 34-bit API calls and 64-bit API calls.  But, if you distribute as an .accde, you must compile each using the appropriate version of Office.  I don't think the  compiler directive solves the problem since the code has to be compiled and that requires knowledge of the bit-version ahead of time.
0
Bobby McKnightProject Controls Technical Specialist Author Commented:
We are both using 64-bit versions of Office.  I updated from Office 2013 32-bit to 64-bit in order match my co-worker's 64-bit version and increase Excel performance back in January.  I converted the few pieces of code that conflicted between the bit versions at that time or the ones that I found that didn't work at least.  I didn't put in the code for adding the Excel reference until after the upgrade from Office '13 32-bit to 64-bit.  Then our whole company was moved to Office 2016 64-bit a few weeks ago.   The code in question still worked in Office 2013 64-bit.  So far it's only been isolated to may machine.
0
PatHartmanCommented:
Is the GUID different for each version?  Is that the correct GUID for Excel 2010?
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Your registry is mucked up a bit.. You more than likely have old key's floating around.

Search for 00020813-0000-0000-C000-000000000046 in the registry.   In the sub-keys, remove any that you don't have installed.   Here's the breakdown:

1.5 for Excel 2003.
1.6 for Excel 2007.
1.7 for Excel 2010.
1.8 for Excel 2013.
1.9 for Excel 2016.

  The GUID may appear in multiple places, so keep checking the rest of the registry.   And of course it goes without saying, MAKE SURE YOU HAVE A BACKUP OF THE REGISTRY.

 Also check for 2DF8D04C-5BFA-101B-BDE5-00AA0044DE52, which is for Office.  You should have 2.6 and up only.

Jim.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
and note on the Office key of 2DF8D04C-5BFA-101B-BDE5-00AA0044DE52

 This is where the problem may lie.   2.6 and 2.7 co-mingle with Office 2013 and 2016 from what I understand.   2.8 is strictly Office 2016.

Jim.
1
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Oh and you might want to try just first opening Excel and letting it "repair".   If that doesn't work, then re-install.

Jim.
0
Bobby McKnightProject Controls Technical Specialist Author Commented:
As far as I know, they are the same.  I have a separate function that will print the Reference Properties for all assigned references  in the Immediate window.  The GUID came up the same on both machines.  The version # is different but the GUID is the same.  I included the Reference properties below.

Name:         VBA
FullPath:     C:\Program Files\Common Files\Microsoft Shared\VBA\VBA7.1\VBE7.DLL
Version:      4.2
GUID:         {000204EF-0000-0000-C000-000000000046}
Name:         Access
FullPath:     C:\Program Files\Microsoft Office\Root\Office16\MSACC.OLB
Version:      9.0
GUID:         {4AFFC9A0-5F99-101B-AF4E-00AA003F0F07}
Name:         stdole
FullPath:     C:\Windows\system32\stdole2.tlb
Version:      2.0
GUID:         {00020430-0000-0000-C000-000000000046}
Name:         DAO
FullPath:     C:\Program Files\Common Files\Microsoft Shared\OFFICE16\ACEDAO.DLL
Version:      12.0
GUID:         {4AC9E1DA-5BAD-4AC7-86E3-24F4CDCECA28}
Name:         Office
FullPath:     C:\Program Files\Common Files\Microsoft Shared\OFFICE16\MSO.DLL
Version:      2.8
GUID:         {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}
Name:         Excel
FullPath:     C:\Program Files\Microsoft Office\Root\Office16\EXCEL.EXE
Version:      1.9
GUID:         {00020813-0000-0000-C000-000000000046}
0
Bobby McKnightProject Controls Technical Specialist Author Commented:
There were left over keys for 1.8 and 2.5.  The code worked perfectly after deleting those old registry entries.

Thanks a Bunch.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
dll

From novice to tech pro — start learning today.