Solved The Expression ... you entered as the event property setting produced the following error: Requested type library or wizard is not a vba project

CarltonJ

New member
Local time
Today, 17:31
Joined
May 3, 2012
Messages
1
I have spent a few painful weeks trying to workaround this one and now have a solution to share that worked for me.

BACKGROUND
The issue appears as an error message and as soon as the database opens and any VBA code is run. All the VBA code is immediately disabled!
The error message is "The Expression On Open you entered as the event property setting produced the following error: Requested type library or wizard is not a vba project" (the On Open underlined above varies, depending on which VBA code procedure the error is triggered in)

In my case the error message appeared as soon as my database opened and the "On_Open" code of the first form loaded generated the follwing error.
"The Expression On Open you entered as the event property setting produced the following error: Requested type library or wizard is not a vba project"
My scenario. I have been developing a new database front end application for a client and as per normal, I save as an ACCDE to protect from changes, and usually rename this file to ".accdr" to run using the runtime to hide tables etc.
The problem came when I decided to use an existing front-end database ".accdr" file as a "library" for it's code modules that I want to share with my new application. I did this by the usual method i.e. adding a VBA Library Reference to the my "library" ".accdr" file.

(I haven't used the VBA Library Reference method for years, but this situation was ideal. However, it seems I have stumbled upon an issue that has been around for a couple of years by doing this.)

This method works fine on my PC, even when I convert the ".accdb" file to ".accde". However, as soon as I copy my ".accdr" application file to the client PC and run it I get "The Expression On Open you entered as the event property setting produced the following error: Requested type library or wizard is not a vba project". Click OK to lose the message, but nothing will work without the message repeating instead.

SOLUTION (Hope it works for you too!)
For each file inturn (i.e. the library database source file and the "host" database source file), open in MS Access using the /decompile switch, then do "Debug, Complile..." in the VBA editor and then "File, Save". Then do "File, Save As, Make ACCDE". Then copy these to the client PC (making sure the Libary file is in the same path as was specified in "Tools, References". This worked for me.

Note. If you're happy with giving your client the ".accdb" version of the application file, you probably have not seen this issue. It onlt seems to occur with the ".accde" and ".accdr" saved versions.
 

Users who are viewing this thread

Back
Top Bottom