Microsoft KB Archive/211931

= XL2000: Query Is Not Executed in the Background =

Article ID: 211931

Article Last Modified on 9/27/2003

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition

-



This article was previously published under Q211931





SYMPTOMS
When you run a query in Microsoft Query, the query is not run in the background (asynchronously).



CAUSE
This behavior occurs when one of the following conditions is true:
 * The Open Database Connectivity (ODBC) driver you use to create the query does not support asynchronous queries.

-or-
 * You record or run a macro while the query is executing.



RESOLUTION
To run your query asynchronously, use one of the following methods:
 * Ensure that the ODBC driver you use to create the query supports asynchronous queries.

-or-
 * Do not record or run a macro while the query is executing.



Asynchronous Queries
Microsoft Excel 2000 can execute a query in the background, or asynchronously. Excel 2000 can execute a query and get data asynchronously with ODBC drivers that support asynchronous behavior. All Microsoft ODBC 3.0 drivers support asynchronous executions. Asynchronous execution runs the query in the background so that control is returned to Excel while the external data is retrieved.

Versions of Excel earlier than Excel 97 use synchronous queries only. With synchronous queries, you cannot run the query in the background, and the query must be finished before control is returned to Excel.

Saving Query Definitions and Enabling Background Refresh
After you select the option to return data to Microsoft Excel from Microsoft Query or the Query Wizard, the Returning External Data to Microsoft Excel dialog box appears. In this dialog box, click Properties. The External Data Range Properties dialog box appears. To enable background refresh, click to select the Save Query Definition check box and the Enable Background Refresh check box. (Both of these check boxes are selected by default.)

After the data is returned to Microsoft Excel, if you saved the query definition with the worksheet, you can access the properties for the external data range. To do this, follow these steps:
 * 1) Select a cell in the data range that contains the results of the query.
 * 2) On the Data menu, point to Get External Data, and then click Data Range Properties.

Clearing the Save Query Definition check box after the query returns data to the workbook permanently removes the query definition from the worksheet, but the query results remain. If you click to clear the Save Query Definition check box, and then click OK, you are unable to refresh the query or change the data range properties.

Additional query words: msquery XL2000

Keywords: kbinterop kbprb KB211931

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.