XL97: Run-Time Error 40009 when you Run DAO Macro

Last reviewed: March 19, 1998
Article ID: Q172322
The information in this article applies to:
  • Microsoft Excel 97 for Windows

SYMPTOMS

In Microsoft Excel 97, if you run a Visual Basic for Applications macro that uses Data Access Objects (DAO), you may receive the following error message:

   Run-time error '40009':
   No current row.

This error message occurs when the macro attempts to copy the contents of a recordset into the active worksheet.

CAUSE

This problem occurs if either of the following conditions are true:

  • The recordset includes a field of type BIGINT.

        -or-
    
  • You have installed Microsoft Visual Basic version 5.0 on the same computer.

    Visual Basic 5.0 replaces the Dao350.dll file that is included in Microsoft Office 97 or Excel 97 with a newer copy. Because this newer Dao350.dll file is not fully compatible with Excel 97, Visual Basic macros that use DAO may not work correctly.

WORKAROUND

To work around this problem, use the following appropriate workaround.

Method 1: Field of Type BIGINT Is Included in Recordset

If the recordset contains a field of type BIGINT, you must change the type of the field, and then try running the macro again. Or, exclude the field from the recordset entirely.

Method 2: Microsoft Visual Basic 5.0 Is Installed on Your Computer

To work around this problem, remove or rename the Dao350.dll file that was installed by Microsoft Visual Basic 5.0, and install a new copy of the file that is included with Office 97 or Excel 97.

To rename or remove the existing file, follow these steps.

  1. Quit all running programs.

  2. On the Start menu, point to Find, and then click Files Or Folders.

  3. In the Named box, type "Dao350.dll" (without quotation marks). In the Look In box, select "(C:)". Click to select the Include Subfolders check box, and then click Find Now.

    One copy of Dao350.dll should be found in the following folder:

          C:\Program Files\Common Files\Microsoft Shared\DAO
    

  4. Right-click the Dao350.dll file. On the shortcut menu, click Rename. Change the name of the file to "xDao350.dll" (without quotation marks). Press ENTER.

    -or-

    Right-click the Dao350.dll file. On the shortcut menu, click Delete. Click Yes in the Confirm File Delete dialog box.

  5. Click the Close button.

After you rename or remove the file, install a new copy of Dao350.dll. To do this, use one of the following methods.

Method 1: Download the Revised Dao350.dll file

A revised Dao350.dll file is available. This file is fully compatible with Microsoft Visual Basic for Applications macros that use DAO and is not replaced by Microsoft Visual Basic version 5.0.

The following file is available for download from the Microsoft Software Library:

 ~ Newdao.exe (size: 255200 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

The FTP location is ftp://ftp.microsoft.com/Softlib/MSLFILES/

For additional information about this utility, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q182596
   TITLE     : XL97: Revised Dao350.dll File for "No current row" Error

Method 2: Run Setup Again

Run the Microsoft Office 97 or Microsoft Excel 97 Setup program and click Reinstall. The Setup program reinstalls all missing files, including the Dao350.dll file. When the Setup program is finished, open Excel 97 and verify that the macros that use DAO work correctly.

Method 3: Replace the Dao350.dll File

Copy the Dao350.dll file from your Office 97 or Excel 97 compact disc (CD) to the correct folder on your hard disk. To do this, follow these steps:

  1. Insert the Office 97 or Excel 97 CD into the CD-ROM drive.

  2. Using Windows Explorer, open the following folder on the CD drive

          <R>:\OS\MSAPPS\DAO
    

    where <R>: is the drive letter for the CD-ROM drive.

  3. If Dao350.dll is not visible in Windows Explorer, follow these steps:

        a. On the View menu, click Options. Click the View tab.
    

        b. Click to select Show All Files.
    

        c. Click OK.
    

  4. Right-click the Dao350.dll file. On the shortcut menu, click Copy.

  5. Using Windows Explorer, open the following folder on your hard disk:

          C:\Program Files\Common Files\Microsoft Shared\DAO
    

  6. On the Edit menu, click Paste.

After Windows Explorer copies Dao350.dll from the CD to the hard disk, open Excel 97 and make sure that the macros that use DAO work correctly.

NOTE: If you reinstall Microsoft Visual Basic 5.0, the Dao350.dll file is replaced again, and you need to perform these steps again. However, if you have copied the revised Dao350.dll file that is available in the Microsoft Software Library, the file is not replaced again.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Microsoft Excel 97 and Microsoft Visual Basic 5.0 both include copies of the Dao350.dll file. The version numbers of these files are listed in the following table.

   Product                      Version of Dao350.dll
   --------------------------------------------------

   Excel 97 or Office 97        3.50.3428.0
   Visual Basic 5.0             3.50.3602.0

When you install Visual Basic 5.0, the version number of its Dao350.dll file is higher than the version of the file that is installed with Excel 97; therefore it replaces the Dao350.dll file that is included in Excel 97. If you reinstall Excel 97 or Office 97, the older Dao350.dll file does not replace the newer Dao350.dll file. This is why you cannot correct the problem that is described in this article by simply reinstalling Excel 97 or Office 97.


Additional query words: XL97 copyfromrecordset createworkspace fields
openrecordset openconnection
Keywords : kbprg kbsetup xlvbainfo xldao
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbworkaround


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: March 19, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.