XL97: Run-Time Error Using CreateObject With DAO.DBEngine

Last reviewed: February 27, 1998
Article ID: Q157471
The information in this article applies to:
  • Microsoft Excel 97 for Windows

SYMPTOMS

When you use CreateObject in a Microsoft Excel 97 macro to use DAO (Data Access Objects), you may receive the following error:

   Run-time error '429':
   ActiveX component can't create object

CAUSE

If DAO 3.0 is not installed and you use the following line of code:

   Set x = CreateObject("DAO.DBEngine")

you will receive the error message given above.

NOTE: This line of code will successfully create, without error, a DAO 3.0 object if DAO 3.0 is installed on your computer.

RESOLUTION

With DAO 3.0, the object name is "DAO.DBEngine" and with DAO 3.5, the version provided with Microsoft Excel 97, the object name has changed to "DAO.DBEngine.35". So, if you have DAO 3.5 installed, the following line of code will create, without error, a DAO 3.5 object:

   Set x = CreateObject("DAO.DBEngine.35")

Since the object names for DAO 3.0 and DAO 3.5 are different, it is recommended that you avoid using CreateObject altogether with DAO for your code to be compatible with both versions of DAO.

Instead of using CreateObject to use DAO in your macro, check the appropriate Data Access Object Library in the References dialog box:

  1. With a module sheet active, click References on the Tools menu.

  2. Check the "Microsoft DAO <x.x> Object Library" (where <x.x> is the DAO version) and click OK.

STATUS

This behavior is by design of Microsoft Excel 97.

REFERENCES

For more information about DAO, type the following text in the Office Assistant Window:

   DAO

and click Search. Then click the topic "Data Access Objects and Collections Reference".


Additional query words: XL97 8.00
Keywords : kbcode kbprg xlvbainfo xldao xl97vbmigrate
Version : WINDOWS:97
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 27, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.