Article ID: 157471
Article Last Modified on 11/23/2006
APPLIES TO
- Microsoft Excel 97 Standard Edition
This article was previously published under Q157471
SYMPTOMS
When you use CreateObject in a Microsoft Excel 97 macro to use Data
Access Objects (DAO), 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 described in the "Symptoms" section.
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:
- With a module sheet active, click References on the Tools menu.
- Check the "Microsoft DAO <x.x> Object Library" (where <x.x> is the DAO
version) and click OK.
REFERENCES
For more information about Data Access Objects, type the following text in
the Office Assistant Window:
and click Search. Then click the topic "Data Access Objects and Collections
Reference".
Additional query words: XL97 8.00 Run-time error 429 ActiveX component can t create object
Keywords: kbdtacode kberrmsg kbprogramming KB157471