Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Error Running Macro with Reference to Xlodbc.xla File


View products that this article applies to.

This article was previously published under Q213284

↑ Back to the top


Symptoms

When you run a procedure from a module that contains a reference to the Xlodbc.xla file, the following error message may appear:
Attempt to register Xlodbc32.dll failed.
This error message may appear as soon as you open the workbook that contains a reference to Xlodbc.xla.

↑ Back to the top


Cause

This error message appears when you have installed Excel 2000 and Excel 5.0 in different folders on the same computer.

When you establish a reference to another workbook or library, Microsoft Excel hard-codes the path of the Xlodbc.xla file. The error occurs because the path to the Xlodbc.xla file is still valid, and Microsoft Excel 2000 attempts to open the Excel 5.0 version of the Xlodbc.xla file.

The error does not occur if only one version of Excel is installed on the computer. Instead, if the file cannot be found, the following error message may appear:
Can't find project or library.
See the "More Information" section of this article for more information about the cause of this error message.

↑ Back to the top


Resolution

To resolve this problem, correct the reference to the Excel 5.0 version of the Xlodbc.xla file so it points to the Excel 2000 version of the Xlodbc.xla file.

To do this, follow these steps:
  1. Start Excel and press ALT+F11 to start the Visual Basic Editor.
  2. On the Tools menu, click References, and then click to clear the current reference. Click Browse to establish a new reference to the correct Xlodbc.xla file.
  3. On the File menu, click Close and Return to Microsoft Excel, and then restart Microsoft Excel.

↑ Back to the top


More information

You receive the error message when all of the following conditions are true:
  • Both Excel 5.0 and Microsoft Excel 2000 are installed in separate folders on the same computer.

    -and-
  • A file created in Excel 5.0 contains a Visual Basic for Applications procedure calling SQL functions from a module with a reference to the Excel 5.0 file Xlodbc.xla.

    -and-
  • The procedure is being run from Excel 2000 on the same computer where Excel 5.0 is installed.
The error message,
Attempt to register XLODBC.DLL failed
may also be received if a procedure with a reference to Xlodbc.xla created in Microsoft Excel 2000 is run from Microsoft Excel version 5.0 on the same computer.

↑ Back to the top


References

For more information about calling procedures, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type callingprocedures in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For more information about calling procedures in other workbooks, click Microsoft Excel Help on the Help menu, type Calling procedures in the Office Assistant or the Answer Wizard, and then click Search to view the topic.


For additional information about calling procedures in other workbooks, click the article numbers below to view the articles in the Microsoft Knowledge Base:
213524� XL2000: Can't Find Project or Library When You Run a Macro
230888� OFF2000: System Error H80004005 (-2147467259) Running Macro with UserForm

↑ Back to the top


Keywords: KB213284, kbprogramming, kbprb, kberrmsg

↑ Back to the top

Article Info
Article ID : 213284
Revision : 4
Created on : 9/27/2003
Published on : 9/27/2003
Exists online : False
Views : 310