Microsoft KB Archive/213284

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

Article ID: 213284

Article Last Modified on 9/27/2003

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition

-



This article was previously published under Q213284





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.



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.



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.



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.

