Refresh imported data

Microsoft Office Excel 2003

You can refresh an external data range automatically when you open the workbook, and optionally save the workbook without saving the external data, so that the workbook file size is reduced.

  1. Click a cell in the external data range you want to refresh, and then click Data Range Properties Button image on the External Data toolbar.
  2. Select the Refresh data on file open check box.
  3. If you want to save the workbook with the query definition but without the external data, select the Remove external data from worksheet before saving check box.

ShowRefresh multiple external data ranges

  1. If your worksheet contains more than one external data range that you want to refresh, on the View menu, point to Toolbars, and click External Data.
  2. On the External Data toolbar, click Refresh All Button image to refresh all of the external data ranges in the workbook.

    If you have more than one workbook open, you must click Refresh All in each workbook to refresh external data.

ShowRefresh data in an imported text file

  1. Select the worksheet with your imported text file.
  2. Click Refresh Data Button image on the External Data toolbar.
  3. In the Import Text File dialog box, select your text file, and then click Import.

ShowTip

If you want to import only part of the data in a text file as a refreshable data range, you can create a query to retrieve the data. For more information, see Microsoft Query Help.

ShowAutomatically refresh data at intervals

  1. Click a cell in the external data range, and then click Data Range Properties Button image on the External Data toolbar.
  2. Select the Refresh every box, and then enter the number of minutes between refreshes.

ShowControl the order of refreshes

  1. Click a cell in the external data range you want to refresh first, and then click Refresh Data on the External Data toolbar.
  2. Repeat for each external data range until they are all refreshed in the order you want.

Setting refresh options

ShowRequire a password to refresh an external data range

If your data source requires a password to connect to it, you can require that the password is entered before the external data range can be refreshed. This procedure does not apply to data retrieved from a text file (*.txt) or a Web query (*.iqy).

  1. Click a cell in the external data range, and then click Data Range Properties Button image on the External Data toolbar.
  2. Under Query definition, clear the Save password check box.

Notes

  • Stored passwords are not encrypted.
  • Microsoft Excel prompts for the password only the first time that the external data range is refreshed in each Excel session. The next time you start Excel, you will be prompted for the password again if you open the workbook that contains the query, and then click Refresh Data Button image.

ShowPreserve cell formatting when you refresh an external data range

  1. Click a cell in the external data range, and then click Data Range Properties Button image on the External Data toolbar.
  2. Do one or both of the following
    • If you want to preserve cell formatting that you apply, select the Preserve cell formatting check box under Data formatting and layout.
    • If you want to preserve column widths that you set, clear the Adjust column width check box under Data formatting and layout.

  3. Click OK.
  4. To refresh the external data range, click Refresh Data Button image on the External Data toolbar.

ShowRun a query in the background or while you wait

Running a query in the background allows you to use Microsoft Excel while the query runs.

  1. Click a cell in the external data range, and then click Data Range Properties Button image on the External Data toolbar.
  2. Select the Enable background refresh check box to run the query in the background or clear it to run the query while you wait.

Notes

  • Stop a query    To stop a query from running when Enable background refresh is turned off, press ESC.
  • Stop a background refresh    To stop a query that is running in the background, double-click the Background Refresh Background refresh icon on the status bar to display the External Data Refresh Status dialog box, and then click Stop Refresh.
  • Recording a macro    While you are recording a macro that includes a query, Excel will not run the query in the background. To change the recorded macro so that it runs in the background, edit the macro in the Visual Basic Editor and change the refresh method for the QueryTable object from "BackgroundQuery := False" to "BackgroundQuery := True". For information about editing macros, see Visual Basic Help.

Note  You can check the status of a refresh by clicking Background Refresh Refresh indicator in the status bar. To cancel the query, click Cancel Refresh on the External Data toolbar.