"User-Defined Type Not Defined" Error Message Using DAO (145759)
The information in this article applies to:
- Microsoft Excel 2000
- Microsoft Excel 97 for Windows
- Microsoft Excel for Windows 95
This article was previously published under Q145759 SYMPTOMS
When you run a Microsoft Excel Visual Basic for Applications subroutine
using data access objects (DAO), you may receive one of the following
compile errors:
Compile error:
User-Defined Type Not Defined
Sub or Function Not Defined
CAUSE
You may receive the error message when a subroutine contains code
that uses the Microsoft DAO Object Library, and the library is not
referenced.
RESOLUTION
In order to avoid the error message, perform the following steps.
Microsoft Excel 7.0- Select a Module Sheet.
- On the Tools menu, click References.
NOTE: It is necessary to be on a Module Sheet before you select the
Tools menu because References is not available on the Tools menu on
a worksheet, a dialog sheet, or a chart sheet.
- In the References dialog box, under Available References, click to
select "Microsoft DAO 3.0 Object Library," and then click OK.
If "Microsoft DAO 3.0 Object Library" is not listed in the list box
under Available References, click Browse and look for the
Dao3032.dll file. It should be located in:
\Program Files\Common Files\Microsoft Shared\Dao\Dao3032.dll
Select the file and click OK. This returns you to the References
dialog box. Click OK.
Microsoft Excel 97 and Microsoft Excel 2000- In the Visual Basic Editor, click References on the Tools menu.
- In the References dialog box, under Available References, select
"Microsoft DAO 3.5 Object Library," and then click OK.
If "Microsoft DAO 3.5 Object Library" is not listed in the list box
under Available References, click Browse and look for the Dao350.dll
file. It should be located in:
\Program Files\Common Files\Microsoft Shared\Dao\Dao350.dll
Select the file and click OK. This returns you to the References
dialog box. Click OK.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kberrmsg kbProgramming KB145759 |
---|
|