• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2250
  • Last Modified:

Requested type library or wizard is not a VBA project

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
colevalleygirl
Asked:
colevalleygirl
  • 21
  • 7
  • 6
  • +2
2 Solutions
 
p912sCommented:
>>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
 
colevalleygirlAuthor Commented:
I copied and renamed. Will try copying the (single) control.
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
In this project, does your app make reference to another ACCDE that you've created?
JimD.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
colevalleygirlAuthor Commented:
I'm afraid reconstructing the form by copying the controls/code to a new form didn't help.
0
 
p912sCommented:
Does the MDE error occur on the same machine that the mdb runs ok on?
0
 
p912sCommented:
Are you trying to create a reference in your code rather than creating a static reference thru Tools - References in the VBE?
0
 
colevalleygirlAuthor Commented:
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
 
colevalleygirlAuthor Commented:
p912s: Both ACCDB and ACCDE are running on the same machine. And no, I'm not trying to create a reference in code.
0
 
p912sCommented:
>>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
 
colevalleygirlAuthor Commented:
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
 
colevalleygirlAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
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
 
p912sCommented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<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
 
colevalleygirlAuthor Commented:
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
 
p912sCommented:
Is there code in the OnChange, OnClick, etc of the Tab Control?
0
 
colevalleygirlAuthor Commented:
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
 
colevalleygirlAuthor Commented:
p912s: No code in the Navigation Control at all.
0
 
Rey Obrero (Capricorn1)Commented:
<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
 
colevalleygirlAuthor Commented:
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
 
colevalleygirlAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
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
 
colevalleygirlAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<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
 
Rey Obrero (Capricorn1)Commented:
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
 
colevalleygirlAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<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
 
colevalleygirlAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<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
 
colevalleygirlAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
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
 
colevalleygirlAuthor Commented:
JDettman:
Will do, and will report back.
FYI, although the OS is 64-bit, I'm running 32-bit Office.
0
 
Rey Obrero (Capricorn1)Commented:
colevalleygirl,
start your new db without the error handling codes..
just add them later when everything is running properly..
0
 
colevalleygirlAuthor Commented:
JDettman:

You're right; it didn't fix it.
0
 
colevalleygirlAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
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
 
colevalleygirlAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
colevalleygirl,

your form is definitely corrupted.
you need to recreate it.
0
 
colevalleygirlAuthor Commented:
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
 
FrankZwolinskiCommented:
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
 
colevalleygirlAuthor Commented:
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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 21
  • 7
  • 6
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now