How to remove all references to 365 on a computer using Access 2010

Mel Brooks
Mel Brooks used Ask the Experts™
on
I have an Access application compiled in 2010.  In one part of the code it opens another database also compiled in 2010 and saved as an accde file.  to open the second application I am using  this approach.
Dim accapp as Access.Application
Set accapp = New Access.Application
accapp.OpenCurrentDatabase PathToAccdeFile

This works well on most workstations on our network, but we have a few where the accde file is attempting to load in Office 365 and we are getting all kinds of errors because 365 isn't fully loaded on that machine and so of  course the user isn't signed into an Office 365 account.
How do I remove all references to 365 so that  Access will load the application in 2010?  The accde file type is already associated with Office 2010.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Daniel PineaultPresident / Owner CARDA Consultants Inc.
Distinguished Expert 2018

Commented:
You could also try an use CreateObject and specify the version to use for the automation

Dim oAccess As Object
Set oAccess = CreateObject("Access.Application.14")
...

Open in new window


You may also like to read over Wayne Philips article How to specify which version of Access to use for OLE automation

Author

Commented:
Daniel,
I think your option is going to work and might be  a better option if it will allow for multiple versions of access to remain on the computer.  The code opens the accde fine on my computer, but I can't test it on the computers with the errors until Monday.

-Mel

Author

Commented:
Daniel,
I hope your suggestion would work, but it didn't.


aravind,
I tried the instructions from your link, but under the Settings menu for removing Microsoft Office Desktop, the Uninstall option is greyed out and unavailable.  Keep in mind that this issue is profile specific.  the profile I'm logged in under does not have admin privileges. I did launch a powershell command using admin rights and ran the following  commands which appeared to uninstall the application, but  when the code launched the accde file again, the program tried to load in Office  365 (2016) rather than the default Access version of 2010.

"(Get-AppxPackage -Name Microsoft.Office.Desktop).Dependencies | Remove-AppxPackage"
then
"Get-AppxPackage -Name Microsoft.Office.Desktop | Remove-AppxPackage"
That will typically throw an error if everything is already removed.

Then to verify that it is indeed removed, this command should return nothing.
"(Get-AppxPackage -Name Microsoft.Office.Desktop).Dependencies"

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial