XL97: Run-Time Error Using CreateObject With DAO.DBEngineLast reviewed: February 27, 1998Article ID: Q157471 |
The information in this article applies to:
SYMPTOMSWhen 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 CAUSEIf 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.
RESOLUTIONWith 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:
STATUSThis behavior is by design of Microsoft Excel 97.
REFERENCESFor more information about DAO, type the following text in the Office Assistant Window:
DAOand click Search. Then click the topic "Data Access Objects and Collections Reference".
|
Additional query words: XL97 8.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |