Run-time Error '424': Object Required Using DAO
This article was previously published under Q163475
This article has been archived. It is offered "as is" and will no longer be updated.
IMPORTANT: This article contains information about editing the registry.Before you edit the registry, make sure you understand how to restore it ifa problem occurs. For information about how to do this, view the "Restoringthe Registry" Help topic in Regedit.exe or the "Restoring a Registry Key"Help topic in Regedt32.exe.
When you run a Visual Basic for Applications macro that uses Data AccessObject, you may receive the following error message:
Run-time Error '424':
This problem may occur when either of the following is true:
- The Data Access Object library is not properly referenced. -or-
- The Data Access Object files are missing, damaged, or improperly registered.
To resolve this problem, use the following appropriate method.
Method 1: Data Access Object Library Is Not RegisteredWARNING: Using Registry Editor incorrectly can cause serious problems thatmay require you to reinstall your operating system. Microsoft cannotguarantee that problems resulting from the incorrect use of Registry Editorcan be solved. Use Registry Editor at your own risk.
For information about how to edit the registry, view the "Changing Keys AndValues" Help topic in Registry Editor (Regedit.exe) or the "Add and DeleteInformation in the Registry" and "Edit Registry Data" Help topics inRegedt32.exe. Note that you should back up the registry before you edit it.If you are running Windows NT, you should also update your EmergencyRepair Disk (ERD).
If the Data Access Object library is not properly referenced, follow thesesteps to create a reference to the library:
Microsoft Excel 97:
- Open the file and press ALT+F11 to open the Visual Basic Editor.
- In the Visual Basic Editor, click References on the Tools menu.
- In the References dialog box, under Available References, click "Microsoft DAO 3.5 Object Library," and then click OK.
If "Microsoft DAO 3.5 Object Library" is not listed in the box under Available References, click Browse and find the Dao350.dll file.
This file is located in the following folder:
Program Files\Common Files\Microsoft Shared\Dao
- Click the file and click OK.
- Click a Module Sheet.
- On the Tools menu, click References.
NOTE: It is necessary click a Module Sheet. References is not available on the Tools menu on a worksheet, dialog sheet, or chart sheet.
- In the References dialog box, under Available References, click "Microsoft DAO 3.0 Object Library," and then click OK.
If "Microsoft DAO 3.0 Object Library" is not listed in the box under Available References, click Browse and find the Dao3032.dll file.
This file is located in the following folder:
Program Files\Common Files\Microsoft Shared\DaoClick the file and click OK.
- In the References dialog box, click OK.
Also, if you reference the Microsoft Access Object Library, it must bereferenced BEFORE the Microsoft Data Access Object Library. To change theorder in which libraries are referenced in Microsoft Excel 97, select theappropriate library in the References dialog box. Then, use the Prioritybuttons to move the references up and down in the list as required. Whenyou are done, click OK.
In Microsoft Excel 7.0, if the Microsoft Data Access Object Library isreferenced BEFORE the Microsoft Access Object Library, click the MicrosoftData Access Object Library to remove the check mark from the check box andClick OK. From the Tools menu, click Reference and select the MicrosoftData Access Object Library check box to reselect this option. Click OK.This places the Microsoft Data Access Object Library reference after theMicrosoft Access Object Library in the reference list.
Method 2: Data Access Object Files are Missing, Damaged, or UnregisteredMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Testing the Data Access Object Engine:
Before you proceed with the steps to replace the Data Access Object files,test the Data Access Object engine with a macro to ensure that it isworking. To do this, type the following macro in a new module, and then runthe macro:
If the macro returns an error message, and you already referenced the DataAccess Object library, you must reinstall the Data Access Object engine byremoving and then reinstalling it. If you installed Data Access Objectmultiple times, (this can occur when you install multiple programs), youmust edit the registry so that the Data Access Object components areremoved when you remove Microsoft Office. To edit the registry, use thefollowing steps:
Sub DAO_Test() MsgBox DBEngine.Version End Sub
- On the Start menu, click Run. In the Open box, type regedit, and then click OK.
- Open the following registry key:
- Click the following value in the SharedDLLs folder:
C:\Program Files\Common Files\Microsoft Shared\DAO\dao3032.dllIf you are using Microsoft Excel 97, click the following value in the SharedDLLs folder:
C:\Program Files\Common Files\Microsoft Shared\DAO\DAO350.DLL
- On the Edit menu, click Modify. The edit DWORD value dialog box appears. If the value data box value is greater than 1, change it to 1, and then click OK.
- On the Registry menu, click Exit.
- Run the Microsoft Office Setup program in maintenance mode. When you are prompted, click Remove All.
- When you are prompted to remove shared components, click Remove All.
If you are prompted to restart the computer after Setup is completed, do so.
- Install Microsoft Office.
- Open the file in Microsoft Excel.
- Click the module sheet to switch to it. If you are using Microsoft Excel 97, press ALT+F11 to start Visual Basic for Applications, and then click the module sheet that contains the Data Access Object macro code.
- On the Tools menu, click References. Clear any references to the Data Access Object libraries. Click OK.
- On the Tools menu, click Add-Ins. If you are using Microsoft Excel 97, you can find the Add-Ins command only on a worksheet. Clear all the add-in check boxes and click OK.
- On the File menu, click Save. Then, click Exit on the File menu.
- Restart Microsoft Excel and open the file. Reference the Data Access Object library you want to use.
For additional information, please see the following article in theMicrosoft Knowledge Base:
178400 OFF97: Installing Win 95 to New Folder to Tshoot Office Problems
97 opendatabase XL7 XL97 XL
Article ID: 163475 - Last Review: 12/04/2015 16:20:37 - Revision: 2.3
Microsoft Excel 97 Standard Edition, Microsoft Excel 95 Standard Edition
- kbnosurvey kbarchive kberrmsg kbprogramming KB163475