Run a saved import or export operation

When you run an import wizard or export wizard in Microsoft Office Access 2007, you can save the settings you used as a specification so that you can repeat the import or export operation at any time.

This article describes how to run a saved operation from within Office Access 2007 or Microsoft Office Outlook 2007.

If you want to schedule an operation to automatically run at regular intervals, see the article Schedule an import or export operation.

What do you want to do?


Save an import or export operation

A specification contains all the information Access needs to repeat the operation without your having to provide any input.

For example, an import specification that imports data from a Microsoft Office Excel 2007 workbook stores the name of the source Excel file, the name of the destination database, and other details, such as whether you appended to or created a new table, primary key information, field names, and so on.

You must first run an import or export operation to save a specification; however, you can use an existing specification for an operation that you have never performed before if your operation meets either of the following conditions:

  • If the only difference between the operation you want to run and an existing specification is the name of the source file (in case of an import operation) or destination file (in case of an export operation), then you can change the name of the source or destination file mentioned in the existing specification and run the specification.
  • If you need to export formatted data and the only difference between the operation you want to perform and an existing specification is the column or filter settings, you can change the column and filter settings in the specification. The current column and filter settings will always determine what gets exported, not the settings that were in effect at the time of creating the specification.

You can save an import or export operation involving any of the file formats supported in Office Access 2007. However, you will not be able to save the details of a linking operation, or the settings that result when you export only a portion of a datasheet.

Create an import or export specification

  1. On the External Data tab, select the import or export command that you want to run. The commands reside in either the Import or Export groups.

ShowAvailable wizards for importing to or exporting data from common file formats

  1. Follow the instructions in the wizard. After you click Finish, and if Access completes the operation, the Save Import Steps or Save Export Steps dialog box appears.
  2. In the dialog box, click either Save import steps or Save export steps to save the details of the operation as a specification.
  3. In the Save as box, type a name for the specification.
  4. In the Description box, type a description to help you or other users identify the operation at a later time.
  5. To create an Outlook task that reminds you when it is time to repeat this operation, click Create Outlook Task.
  6. Click either Save Import or Save Export to save the specification.

Access creates and stores the specification in the current database.

 Note   If you selected the Create Outlook Task check box in either the Save Import Steps or the Save Export Steps dialog box, an Outlook Task window appears. Fill in the details of the task and then click Save & Close.

Top of Page Top of Page

Run a saved operation from Access

After you save the details as a specification, perform the following steps when you want to repeat the operation.

 Note   When you start the operation this way, you have the option of changing the external source or destination file before you run the specification. For example, you could change the name of the source Excel file from WeeklyReport-London.xlsx to WeeklyReport-Paris.xlsx before you start your import operation.

Run the operation

  1. Open the Access database that contains the specification, if it is not already open. When you run an import specification, the current database is the destination database. When you run an export specification, the current database is the source database.
  2. If the specification exports formatted data to an Excel workbook or a Microsoft Office Word 2007 document, open the object and make sure the fields that you want to export are not hidden in the view. Similarly, review the filter settings to make sure all the records you want exported are visible in the view.
  3. On the External Data tab, click Saved Imports Button image or Saved Exports Button image to select your specification.
  4. In the Manage Data Tasks dialog box, on the Saved Imports or Saved Exports tab, click the specification that you want to run.
  5. If you want to change the source file (when you are running an import operation) or the destination file (when you are running an export operation), click the path of the file to edit it.

It is important to note that you can change the source or destination files, but the new file you specify must satisfy all the requirements essential for successfully completing the operation.

  1. Before you click Run, you must make sure that the source and destination files exist, the source data is ready for importing, and that the operation will not accidentally overwrite any data in your destination file. Do everything that you would do to ensure the success of a wizard-driven operation before running any saved specification.
  2. Click Run.

Access displays a message that communicates the status of the operation. If the operation failed, troubleshoot the error the same way you would if you were using the wizard.

 Tip   If the message does not pinpoint the cause of the failure, try starting the import or export wizard and stepping through the dialog boxes to perform the same operation.

Top of Page Top of Page

Run a saved operation from Outlook

If you have set up the operation as an Outlook task, you can start the operation from within Outlook.

 Note   You cannot change the path or file name of the external file in the specification before starting the operation when you run the specification from within Outlook. To change the file name in the specification, start the operation from within Access instead of as a task from Outlook.

Before you start the operation in Outlook, make sure that Office Access 2007 is installed on your computer and that the source and destination files exist. Do everything that you would do to ensure the success of a wizard-driven operation before you run any saved specification.

Run the operation

  1. Start Outlook and click Tasks in the Navigation Pane. Double-click the task to open it.
  2. On the Task tab, in the Microsoft Office Access group, click Run Import Button image or Run Export Button image. Click OK to confirm.

If the operation runs successfully, no message is displayed. If the operation fails, Access displays a message explaining the likely cause of the error. Try troubleshooting the error the same way you would if you were using the wizard.

 Tip   If the message does not pinpoint the cause of the failure, try starting the import or export wizard and stepping through the dialog boxes to perform the same operation.

Top of Page Top of Page

 
 
Applies to:
Access 2007