Saving Data Queries

The Query Wizard lets you save your query in a file with the file type DQY. Click the Save Query button in the Query Wizard?Finish dialog box (see Figure 22.14) and Excel stores all your queries in the Queries subfolder. To view your query files, open Windows Explorer. In the All Folders pane on the left, open the Documents and Settings folder, Administrator, Application Data, Microsoft, and then you should see the Queries subfolder. When you click Queries, Windows displays your queries in the pane on the right. From here, you can rename or delete query files.

Figure 22.14. Query Wizard?Finish dialog box.



If you want to delete a query that you no longer use, go to Windows Explorer. In the All Folders pane on the left, display the following folders: Documents and Settings, Administrator, Application Data, Microsoft, Queries. A query file has the file type DQY. Select the queries you want to delete and click the Delete button on the Explorer toolbar.

After you save your query, select Return Data to Microsoft Excel, if necessary, in the Query Wizard?Finish dialog box. Then click the Finish button. You should see the data you queried from the external database in your worksheet.

Reusing Queries

After you create a query and save it with the Query Wizard, you can run it again and again to retrieve the data you need.

When you want to rerun the query, choose Data, Import External Data, Import Data. Select a query in the list and click Open. In the Import Data dialog box, click a cell in the worksheet and click OK. Excel displays the data starting in the cell you selected.

Another way to rerun the query is to double-click its icon in the folder where you saved it. This method runs the query, starts Excel, and displays the data in a new workbook.

    Part I: Excel Basics