Link to home
Get AccessLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

MS Access Error

I have an access program that I am trying to open from a different computer with a more updated version.  It seems like my first error (attached) is that it cant find WinWord when starting the program.  This error occurs when I open Access for the first time on the new computer.  The question I have is how can I fix this error by telling the program where MS Word is located?

User generated image
Avatar of Kelvin Sparks
Kelvin Sparks
Flag of New Zealand image

You need to set this as a trusted application through the Menu. Find the Access File menu (when you are open - choose Options and then Trust Centre, and then click the Trust Centre Settings button. Set the trusted locations for your MS Access location and those of the databases that you open.

Close and restart Access

Kelvin
I guess a way is to parse registry for locating winword : https://www.actualinstaller.com/help/winword.html
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe

Open in new window

To read the registry : https://docs.microsoft.com/en-us/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-read-a-value-from-a-registry-key
Now 2 questions arise..
1. You need probably VBA to do it ...i am not sure if you can implement it on Macro Level
2. Why use such kind of early early binding...just start your application and use late binding to use the Word functionality..you can check the installation presence like this
Dim obj As Object
    Set obj = CreateObjectType("Word.Application")

    If Not obj Is Nothing Then
     'You have Word so use late Binding to work with it
      set obj = Nothing
    else
      ' Not Installed
     End If

Open in new window


Try to replace the direct call with a more generic:

Start Winword

Open in new window

Avatar of al4629740

ASKER

How can I find where this code is being ran to make the change.  I opened the VB editor but I'm thinking there are some startup properties where this can be found.  As I search for anything that says RunApplication or AutoExec, I don't see it.   I'm not the best at Access so any more detail would help.  
If a macro is called Autoexec, it will run on startup automatically. Holding down Shift while starting Access bypasses that. If you don't want it to run at all, rename the Macro to something else, and call it when you need it.


Kelvin
That works, but when I go to tools and macros to find the Autoexec macro, I don't see it.  Even when I look in the VB Projects window I don't see that Macro
ASKER CERTIFIED SOLUTION
Avatar of Kelvin Sparks
Kelvin Sparks
Flag of New Zealand image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
The shutter bar is also called the Navigation Pane.