Solved

Requested type library or wizard is not a VBA project

Posted on 2010-08-30
41
2,037 Views
Last Modified: 2013-11-28
I am developing an Access application using Access 2010 and almost have it ready to release to beta-testers. However, although it works fine as an ACCDB file, when I create and run an ACCDE file  I get an error 0 (reported via the error handler on the main form) followed by "Requested type library of wizard is not a VBA project".

I have created a copy of the application stripped down to just the main form, which is an Access 2010 Navigation control with a number of sub-forms all of which are empty in the stripped down app, and the error persists. The error message arises when switching to any tab from the tab that is opened when the app first runs.

The ACCDE and ACCDB versions access the same back-end data file, which is in the same directory as they are. They are both being run on the same PC.

The references in the ACCDB look like this
 ACCDB references
The references in the ACCDE look like this:
 ACCDE references
So far, without success, I have:

Decompiled and recompiled the application
Copied the offending form to a new form
Imported everything into a new ACCDB

What else can I try?  
0
Comment
Question by:colevalleygirl
  • 21
  • 7
  • 6
  • +2
41 Comments
 
LVL 18

Expert Comment

by:p912s
ID: 33557573
>>Copied the offending form to a new form

Did you do this by copying the entire form and then renaming? Or did you open the form in design mode and copy all controls/code to a new form? I've had success doing the later in previous versions of Access when a form misbehaved.

0
 

Author Comment

by:colevalleygirl
ID: 33557588
I copied and renamed. Will try copying the (single) control.
0
 
LVL 57
ID: 33557613
In this project, does your app make reference to another ACCDE that you've created?
JimD.
0
 

Author Comment

by:colevalleygirl
ID: 33557628
I'm afraid reconstructing the form by copying the controls/code to a new form didn't help.
0
 
LVL 18

Expert Comment

by:p912s
ID: 33557684
Does the MDE error occur on the same machine that the mdb runs ok on?
0
 
LVL 18

Expert Comment

by:p912s
ID: 33557732
Are you trying to create a reference in your code rather than creating a static reference thru Tools - References in the VBE?
0
 

Author Comment

by:colevalleygirl
ID: 33557766
JDettman: No. The back-end data is in an ACCDB at present; I intend to lock that down as far as possible before deployment. If I ever get that far <sigh>.

In the stripped down version:

There's a single form (frmMain) with a navigation control to which no sub-forms are yet bound.
There are no queries.
There is a linked backend database (which consists of a number of empty tables).
There is an Autoexec macros which calls a Startup function (which initialises error handling and displays the references).
There are three VBA modules: basStartup, modReferences (which contains the subroutine to display the references). and basErrorHandling (which contains a sub-routine to initialise the error handling class.
There is one VBA class module: CVBAErrHandler (which comes from the Total Visual Sourcebook form FMS, as does modReferences).

Happy to post a copy of the stripped down database if it would help.
0
 

Author Comment

by:colevalleygirl
ID: 33557789
p912s: Both ACCDB and ACCDE are running on the same machine. And no, I'm not trying to create a reference in code.
0
 
LVL 18

Expert Comment

by:p912s
ID: 33557811
>>There is an Autoexec macros which calls a Startup function (which initialises error handling and displays the references).

If you disable that and create your MDE does the error go away?
0
 

Author Comment

by:colevalleygirl
ID: 33557815
I should add that the error first occurred before I included the modules modReferences and CVBAErrHandler -- they went in as I attempted to debug the thing.

The only code in frmMain is the form_error routine which uses the errorhandler class to display the error 0.
0
 

Author Comment

by:colevalleygirl
ID: 33557845
p912s: If I disable Autoexec and also comment out the error-handler in frmMain (so it doesn't call code that isn't being initialised via Autoexec/Startup, the error 0 isn't reported (not surprisingly!) but I still get  "Requested type library of wizard is not a VBA project".
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 33557924
colevalleygirl,

disable first the error handling routine,
when you get the error click the debug button
that should take you to the erring code...
0
 
LVL 18

Expert Comment

by:p912s
ID: 33557932
Does the error occur as soon as you launch the MDE?

In Tools - Startup you're calling the main form?

Any other code in the main form in OnCurrent, OnOpen, OnLoad etc... ?
0
 
LVL 57
ID: 33558004
<<JDettman: No. The back-end data is in an ACCDB at present; I intend to lock that down as far as possible before deployment. If I ever get that far <sigh>.>>
  I didn't mean the back end.  I meant does your code reference another ACCDE (typically what we would call a "library").
  In other words, if you look in your list of references in your VBA project, do you have a MDE/Accde in there anywhere?
  If it does, it poses a bit of a problem in that the path to references are stored.  If you move the de's to another folder, then that reference breaks.
 The other thing that typically generates this error is the use of CurrentDB() in a library DE when you should be using CodeDB().
JimD.
0
 

Author Comment

by:colevalleygirl
ID: 33558047
capricorn1: It's happening in an executable-only file (ACCDE like MDE). So no debug option.

p912s:

Does the error occur as soon as you lunch the MDE? No, only when moving on the navigation control from the initial "tab" to another "tab". It doesn't matter which "tab" (of four) you move to; and the error doesn't repeat itself when you subsequently move to any other "tab". If the form is closed and then reopened, the error happens again on the first change of tab and then not on subsequent tab changes.

In Tools - Startup you're calling the main form? Yes, but the same error occurs if Startup is bypassed and the form is invoked by double-clicking in it in the navigation pane.

Any other code in the main form in OnCurrent, OnOpen, OnLoad etc... ? No code at all.

0
 
LVL 18

Expert Comment

by:p912s
ID: 33558115
Is there code in the OnChange, OnClick, etc of the Tab Control?
0
 

Author Comment

by:colevalleygirl
ID: 33558221
JDettman: The list of references are in the original post. No ACCDE/MDE that I can recognise there. And I've searched all the code for CurrentDB -- no reference to it at all.

I have now stripped the thing down completely -- no data tables (including linked tables) except the hidden/system ones that Access produces. No modules. No code in the main form. No subforms. The error still happens.

I've also created a totally new database with no tables and a single navigation form without code. The error doesn't happen.

Which suggests some corruption somewhere -- but how can I correct it?
0
 

Author Comment

by:colevalleygirl
ID: 33558233
p912s: No code in the Navigation Control at all.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 33558265
<I have now stripped the thing down completely -- no data tables (including linked tables) except the hidden/system ones that Access produces. No modules. No code in the main form. No subforms. The error still happens.>

on this strip down db,
do a compact and repair
do a decompile
from vba window do a Debug>compile

clear any errors raised

create an accde,

post the result

to do a decompile

http://www.granite.ab.ca/access/decompile.htm
0
 

Author Comment

by:colevalleygirl
ID: 33558365
capricorn1: I did all that before I posted the query, as per the OP, but I have repeated it on the stripped down db as you suggest.

The error still happens.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:colevalleygirl
ID: 33558384
I've now also removed the custom ribbon that I'd forgotten about (which was jusr=t a cut-down version of the standard Main ribbon).

Error is still there.
0
 
LVL 57
ID: 33558483
Just for the heck of it (won't take long), please try the following:
Using the ACCDB:
1. Verify the list of references you posted in your opening comment by opening a code module and looking at the references yourself.
2. Check that none are listed as MISSING or BROKEN.  If some are, then stop

3. Check any un-checked reference.
4. Close the app and access
5. Re-open and un-check the reference you just checked (it will be at the bottom of the refererences that are checked).
6. Compile.  Make sure no errors.
7. Save and close
8. Convert to ACCDE and test.
JimD.
0
 

Author Comment

by:colevalleygirl
ID: 33558624
JDettman:

The list of references is correct, and none are missing or broken.
Have followed steps 3-8.
The error is still there.

It must be a corruption somewhere, but goodness knows where. I think at this point I need to embark on the long process of reconstructing everything in a totally fresh database...
0
 
LVL 57
ID: 33558664
<<The error message arises when switching to any tab from the tab that is opened when the app first runs.>>
 Put a stop at the top of the OnChange event.  See if you hit the stop.  If you do, hit F8 and step through the code until you get the error.  That may reveal something.
JimD.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 33558690
you save sometime by saving the form as text file

 Application.SaveAsText acForm, "NameOfForm", "c:\MyForms\NameOfForm & ".txt"

to get the form back to the New db

Application.LoadFromText acForm, ""NameOfForm", "c:\MyForms\NameOfForm & ".txt"

0
 

Author Comment

by:colevalleygirl
ID: 33558839
JDettman:
The error occurs between the Mousedown event and the Click event for a Navigation button on the Navigation control. However, I don't think that gets me very far as there isn't any code to step through.

Capricorn1: Yes, there's some code at http://www.datastrat.com/Code/DocDatabase.txt which might speed things up.
0
 
LVL 57
ID: 33558947
<<The error occurs between the Mousedown event and the Click event for a Navigation button on the Navigation control. However, I don't think that gets me very far as there isn't any code to step through.>>
  Sorry, thought is was a tab in a form.  Still, I'd try the stop.  You may have some code executing that you don't realize (ie. a timer in the background).
JimD.
0
 

Author Comment

by:colevalleygirl
ID: 33559035
JDettman:
There's nowhere for any code to come from. In the stripped down version, the form's module is empty (apart from the events I put in for the Got Focus, MouseDown and Click events for the navigation button) and there is no autoexec macro or any other module.

The whole application now reads:


Option Compare Database
Option Explicit
     
Private Sub btnLists_Click()
     Call MsgBox("Click", vbOKOnly + vbInformation + vbSystemModal + _
       vbDefaultButton1, "Family History Research Manager")
End Sub

Private Sub btnLists_GotFocus()
     Call MsgBox("Got Focus", vbOKOnly + vbInformation + vbSystemModal + _
       vbDefaultButton1, "Family History Research Manager")
End Sub

Private Sub btnLists_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
     Call MsgBox("Mousedown", vbOKOnly + vbInformation + vbSystemModal + _
       vbDefaultButton1, "Family History Research Manager")

End Sub

Open in new window

0
 
LVL 57
ID: 33559163
<<There's nowhere for any code to come from. In the stripped down version, the form's module is empty (apart from the events I put in for the Got Focus, MouseDown and Click events for the navigation button) and there is no autoexec macro or any other module.
>>
  I guess I'm a little confused then on how your error handler can be trapping an error.  Something is getting called from some where that is raising the error.
JimD.
0
 

Author Comment

by:colevalleygirl
ID: 33559240
JDettman:

If I add an error handler back into the single form, it traps an error 0 at line 0 before the Access message Requested type library or wizard is not a VBA project appears. I removed the error handler to eliminate it as the cause of the error (if that makes sense!).

0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 350 total points
ID: 33559307
Got it.  Well that then says it's references in some way.  But we've been over all the typical stuff.
I did just notice that your running this under a 64bit OS.  There have been various issues with that.  Mostly with ODBC drivers.
As you said, it's at the point where you need to build a clean DB.  But I have a hunch that's not going to fix it.  May be wrong though.
Build a clean DB out of your minimal one and see if you get the same result.  Don't need to do anything other then create a fresh DB container and then import the objects into it.
JimD.
 
0
 

Author Comment

by:colevalleygirl
ID: 33559453
JDettman:
Will do, and will report back.
FYI, although the OS is 64-bit, I'm running 32-bit Office.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 33559504
colevalleygirl,
start your new db without the error handling codes..
just add them later when everything is running properly..
0
 

Author Comment

by:colevalleygirl
ID: 33559911
JDettman:

You're right; it didn't fix it.
0
 

Author Comment

by:colevalleygirl
ID: 33560314
If I delete the form containing the Navigation Control, everything else in the database seems to run OK in an ACCDE  -- at least with cursory testing.

Looks like it might be time to roll my own navigation control...
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 33560367
i am wondering what you got on that form with the navigation control that will cause the error.

can you upload a sample db with that form?
0
 

Author Comment

by:colevalleygirl
ID: 33560463
Here's a sample.

Save it as an ACCDE, and click on any button on the top row to see the error. If you click on the Lists button you'll get messages showing the Got Focus, MouseDown and Click events as well as the error message.

CleanestFHRM.accdb
0
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 150 total points
ID: 33563860
colevalleygirl,

your form is definitely corrupted.
you need to recreate it.
0
 

Author Comment

by:colevalleygirl
ID: 33568980
I've now re-created the main form -- still using a navigation control -- and can get it to compile and run as an ACCDE. So definitely looks like it was a corruption somewhere.
0
 

Expert Comment

by:FrankZwolinski
ID: 35743544
I understand there is a bug with the Navigation form when executing  an ACCDE. It runs fine in an ACCDB, but this annoying message only appears when compiled to an ACCDE.

I did find a workaround. Simply add the this code to the Navigation Form On Error event.
If you trap for DataErr of -25357 and change the response parameter to acDataErrContinue, Access will not display the error and the form will behave as expected.  This doesn't fix the problem, it simply hides it.


Private Sub Form_Error(DataErr As Integer, Response As Integer)

If DataErr = -25357 Then
   ' MsgBox "This is a problem error. HIde the error with the Response parameter  "
     Response = acDataErrContinue
End If

End Sub
1
 

Author Comment

by:colevalleygirl
ID: 35744449
Thanks. In the end, I recoded the app to use the ribbon for navigation, but this way would have been a lot quicker.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now