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

CreateObject("Access.Application") - Object library feature not supported when compiling VBA code in Access module

I copied a .MDB application file from a Win2000 machine to a WinXP machine.  Both machines have Access 2002 loaded.  When I try to execute the .MDB file on the WinXP machine, I get an error popup that says "Compiler error: Object library feature not supported".  My code is

Dim Nacc As Access.Application    
Set Nacc = CreateObject("Access.Application") <- compiler highlights the Nacc in this line

Both Machines have Visual Basic 6.3 but the WinXP machine has Retail: 6.4.9972 and the Win2000 machine has Retail: 6.3.8863.  I've copied the 6.3.8838 vbe6.dll and vbe6ext.olb files to the WinXP machine and still get the same error.  I checked all of the references in the Access programs on  both machines and they appear to be identical.  Thanks for any help
3 Solutions
>> Dim Nacc As Access.Application    

Considering this line works im sure your access install is fine.

Try this

Dim Nacc As Access.Application    
Set Nacc = New Access.application

Should be faster too :-)
cacomputerguyAuthor Commented:
Before I posted here, I went to the Microsoft site and saw this alternative way of setting up an Access Application interface.  I tried the New Access.Application and I get the "Microsoft Access has encountered a problem and needs to close" error.  The details are AppName: msaccess.exe     AppVer: 10.0.2616.0     ModName: vbe6.dll     ModVer:     Offset: 0009792f .  I have other, much larger Access applications running on the WinXP machine and they don't have a problem (of course, they don't have this call).  
May i ask why you need this?  Maybe there is another way around it
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

cacomputerguyAuthor Commented:
Sure.  I have an automated "process" for creating an MDE file from an MDB front-end.  The code looks like this -
    ' The following lines simulate accepting the default name, clicking Make MDE and clicking Save
    SendKeys "C:\Program Files\x.MDB" & "{Enter}"     ' path and db name of mdb file
    SendKeys "C:\Program Files\x.MDE" & "{Enter}"               ' default to putting the mde in the same folder
    If FileExist("C:\Program Files\x.MDE") Then
        SendKeys "Y"                 ' answer yes to the replace question
    End If
    SendKeys "{Enter}"               ' Save the mde file
    Nacc.DoCmd.RunCommand acCmdMakeMDEFile

If there's an easier way of making an MDE, I'm all for it.
ill put a call out to the others... I found the PAQ where you got this from... I'd still suggest using the menu's personally...


why are you creating the MDE from within Access itself?  This is NOT something that you want average users doing.  It should ONLY be done by the developer of the application, and should only need to be done once.  This is not something that should need to be done repeatedly.

Before you create an MDE, you MUST be ABSOLUTELY sure that the code compiles correctly, and that can only be done manually, so that would seem to preclude the 'automated' generation of the MDE.

cacomputerguyAuthor Commented:
Thanks, AW.  I AM the developer and my application is compiled and sent out in different versions about 5 times a week.  This is NOT a process that the average user does.  I DO assure a clean compile before making the MDE because the application is compiled and tested in a test environment BEFORE it is packaged into the production versions.  I guess I'm just lazy and want the automated MakeMDE to work on the WinXP machine EXACTLY as it has for the last 1.5 years on the Win2000 machine.
Chuck WoodCommented:
I found some suggested fixes:

You will receive an "Object library feature not supported" message. Placing an underscore in front of the object and enclosing it in square brackets will generally resolve this problem. The variable should be declared as Access.[_Application].

The solution was to change the order of the references (Tools menu in vb window). There seemed to be no logic to my change in order of references - it was just trial and error.

Under Tools | References, there is a huge list. No entries have "Missing" in front of them. If none have "MISSING:", select an additional reference at random, back out of the dialog, then go back in and unselect the reference you just added. That worked!

You might want to try one or more of these.

Rather than using sendkeys (which is evil), I would recommend creating a .bat file with the necessary commands.

<Full Access 2003 Path> <Full 97 MDB Path> / convert <Full 2003 MDB Path>

You could create a macro in the database that will convert the MDB to an MDE (or call the code that does it)
<Full Access 2003 Path> <Full 2003 MDB Path> /x <macroname>

The macro could call some code that would tell what the file name should be, based on the version of the software, so it would be somewhat flexible.

I'm sure that you also know that to make an MDE, the MDB must be in the native format too (ie. A2K will only make MDE's that work on A2K)


cacomputerguyAuthor Commented:
Thanks guys.  cwood-wn-com got me past the compile step.  All three of these methods worked and got it past the compile error, however it didn't create the MDE.  Flavo and dannywareham both had good advice.  Guess I just need to suck it up and use the menus or spend more time to get a batch routine going.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now