Part III: More-Advanced Access Techniques
592
l (^) Excel columns may contain virtually any type of data. Just because you have successfully
linked to an Excel worksheet doesn’t mean that your application will be able to use all the
data contained in the worksheet. Because Excel doesn’t limit the types of data contained
in a worksheet, your application may encounter multiple types of data within a single col-
umn of a linked Excel worksheet. This means that you may have to add code or provide
other strategies for working around the varying types of data contained in an Excel
worksheet.
On the CD-ROM
This book’s CD contains an Excel spreadsheet created by exporting the Products table from the Collectible
Mini Cars application. Use this file to practice linking to Excel data, keeping in mind that, in practice, the data
you’re likely to encounter in Excel spreadsheets is far more complex and less orderly than the data contained
in the Products.xls file.
By linking to an Excel table, you can update its records from within Access or any other applica-
tion that updates Excel spreadsheets.
Follow these steps to link to the Excel Products.xls spreadsheet:
- In the Chapter16 database, click the Excel button on the External Data ribbon.
The Get External Data dialog box (shown in Figure 16.7) appears.
- In the Get External Data dialog box, select Link to the Data Source by Creating a Linked
Table, and click Browse.
The same Get External Data dialog box is used for both import and link operations. So,
be sure the correct operation is selected before continuing.
Cross-Reference
Importing data into Access is discussed in Chapter 17.
- Click the Browse button to the right of the filename box.
The File Open dialog box appears.
- Locate and open the Excel file.
You’re returned to the Link Spreadsheet Wizard (see Figure 16.8).
Notice that the Link Spreadsheet Wizard contains options for selecting either worksheets
or named ranges within the workbook file. In this example, there are three different
worksheets (named Products, Sales, and Contacts) within the spreadsheet file.
- Select the Products worksheet for this demonstration.
- The Link Spreadsheet Wizard walks you through a number of different screens where
you specify details such as First Row Contains Column Headings and the data type you
want to apply to each column in the Excel worksheet.