Microsoft KB Archive/123264

{|
 * width="100%"|

XL5: Improving Performance Using XLODBC.XLA

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 5.0, 5.0c

-

SUMMARY
When you use the ODBC add-in, XLODBC.XLA, to access Visual Basic SQL functions in Microsoft Excel, you can improve performance on your computer in some cases by running the Auto_Close macro either before you close the XLODBC.XLA file or before you close Microsoft Excel.

MORE INFORMATION
The XLODBC.XLA file contains an Auto_Close macro that, in some instances, releases allocated memory. However, this Auto_Close macro does not run when you use a Visual Basic procedure to close the file. Because of this behavior, when you use SQL functions provided by XLODBC.XLA in a Visual Basic procedure, use the following command in your procedure prior to a command that closes XLODBC.XLA or Microsoft Excel:

"Workbooks('xlodbc.xla').RunAutoMacros xlAutoClose" This command ensures that the Auto_Close macro in the XLODBC.XLA runs before the add-in file is closed.

Note that you do not need to use this command if you close Microsoft Excel manually, using the Close command on the File menu.

Microsoft provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.