Note: Microsoft Access doesn’t support importing Excel data with an applied sensitivity label. As a workaround, you can remove the label before importing and then re-apply the label after importing. For more information, see Apply sensitivity labels to your files and email in Office.
You can bring the data from an Excel workbook into Access databases in many ways. You can copy data from an open worksheet and paste it into an Access datasheet, import a worksheet into a new or existing table, or link to a worksheet from an Access database.
This topic explains in detail how to import or link to Excel data from Access desktop databases.
What do you want to do?
Understand importing data from Excel
If your goal is to store some or all of your data from one or more Excel worksheets in Access, you should import the contents of the worksheet into a new or existing Access database. When you import data, Access creates a copy of the data in a new or existing table without altering the source Excel worksheet.
Common scenarios for importing Excel data into Access
-
You are a long-time user of Excel but, going forward, you want to use Access to work with this data. You want to move the data in your Excel worksheets into one or more new Access databases.
-
Your department or workgroup uses Access, but you occasionally receive data in Excel format that must be merged with your Access databases. You want to import these Excel worksheets into your database as you receive them.
-
You use Access to manage your data, but the weekly reports you receive from the rest of your team are Excel workbooks. You would like to streamline the import process to ensure that data is imported every week at a specific time into your database.
If this is the first time you are importing data from Excel
-
There is no way to save an Excel workbook as an Access database. Excel does not provide functionality to create an Access database from Excel data.
-
When you open an Excel workbook in Access (in the File Open dialog box, change the Files of Type list box to Microsoft Office Excel Files and select the file you want), Access creates a link to the workbook instead of importing its data. Linking to a workbook is fundamentally different from importing a worksheet into a database. For more information about linking, see the section Link to data in Excel, later in this article.
Import data from Excel
The steps in this section explain how to prepare for and run an import operation, and how to save the import settings as a specification for later reuse. As you proceed, remember that you can import data from only one worksheet at a time. You cannot import all the data from a whole workbook at the same time.
Prepare the worksheet
-
Locate the source file and select the worksheet that contains the data that you want to import to Access. If you want to import only a portion of a worksheet, you can define a named range that includes only the cells that you want to import.
Define a named range (optional)Â Â Â-
Switch to Excel and open the worksheet that has data that you want to import.
-
Select the range of cells that contain the data that you want to import.
-
Right-click within the selected range and then click Name a Range or Define Name.
-
In the New Name dialog box, specify a name for the range in the Name box and click OK.
Remember that you can import only one worksheet at a time during an import operation. To import data from multiple worksheets, repeat the import operation for each worksheet.
-
-
Review the source data and take action as described in this table.
Element
Description
Number of columns
The number of source columns that you want to import cannot exceed 255, because Access does not support more than 255 fields in a table.
Skipping columns and rows
It is a good practice to include only the rows and columns that you want to import in the source worksheet or named range.
Rows    You cannot filter or skip rows during the import operation.
Columns    You cannot skip columns during the operation if you choose to add the data to an existing table.
Tabular format
Ensure that the cells are in tabular format. If the worksheet or named range includes merged cells, the contents of the cell are placed in the field that corresponds to the leftmost column, and the other fields are left blank.
Blank columns, rows, and cells
Delete all unnecessary blank columns and blank rows in the worksheet or range. If the worksheet or range contains blank cells, try to add the missing data. If you are planning to append the records to an existing table, ensure that the corresponding field in the table accepts null (missing or unknown) values. A field will accept null values if its Required field property is set to No and its ValidationRule property setting doesn't prevent null values.
Error values
If one or more cells in the worksheet or range contain error values, such as #NUM and #DIV, correct them before you start the import operation. If a source worksheet or range contains error values, Access places a null value in the corresponding fields in the table. For more information about ways to correct those errors, see the section Troubleshoot missing or incorrect values, later in this article.
Data type
To avoid errors during importing, ensure that each source column contains the same type of data in every row. Access scans the first eight source rows to determine the data type of the fields in the table. We highly recommend that you ensure that the first eight source rows do not mix values of different data types in any of the columns. Otherwise, Access might not assign the correct data type to the column.
Also, it is a good practice to format each source column in Excel and assign a specific data format to each column before you start the import operation. Formatting is highly recommended if a column includes values of different data types. For example, the FlightNo column in a worksheet might contain numeric and text values, such as 871, AA90, and 171. To avoid missing or incorrect values, do the following:
-
Right-click the column header and then click Format Cells.
-
On the Number tab, under Category, select a format. For the FlightNo column, you would probably choose Text.
-
Click OK.
If the source columns are formatted, but still contain mixed values in the rows following the eighth row, the import operation might still skip values or convert values incorrectly. For troubleshooting information, see the section Troubleshoot missing or incorrect values.
First row
If the first row in the worksheet or named range contains the names of the columns, you can specify that Access treat the data in the first row as field names during the import operation. If your source worksheet or range doesn't include the names, it is a good idea to add them to the source before you start the import operation.
Note:Â If you plan to append the data to an existing table, ensure that the name of each column exactly matches the name of the corresponding field. If the name of a column is different from the name of the corresponding field in the table, the import operation will fail. To see the names of the fields, open the table in Design view in Access.
-
-
Close the source workbook, if it is open. Keeping the source file open might result in data conversion errors during the import operation.
Prepare the destination database
-
Open the Access database where the imported data will be stored. Ensure that the database is not read-only, and that you have permissions to make changes to the database.
-or-
If you don't want to store the data in any of your existing databases, create a blank database. To do so:
Click the File tab, click New, and then click Blank Database.
-
Before you start the import operation, decide whether you want to store the data in a new or existing table.
Create a new table    If you choose to store the data in a new table, Access creates a table and adds the imported data to this table. If a table with the specified name already exists, Access overwrites the contents of the table with the imported data.
Append to an existing table    If you choose to add the data to an existing table, the rows in the Excel worksheet are appended to the specified table.
Remember that most failures during append operations occur because the source data does not match the structure and field settings of the destination table. To avoid this, open the destination table in Design view and review the following:
-
First row    If the first row of the source worksheet or named range does not contain column headings, ensure that the position and data type of each column in the source worksheet matches those of the corresponding field in the table. If the first row contains column headings, the order of columns and fields do not need to match, but the name and data type of each column must exactly match those of its corresponding field.
-
Missing or extra fields    If one or more fields in the source worksheet do not exist in the destination table, add them before you start the import operation. However, if the table contains fields that don't exist in the source, you do not need to delete those fields from the table if they accept null values.
Tip:Â A field will accept null values if its Required property is set to No and its ValidationRule property setting doesn't prevent null values.
-
Primary key    If the table contains a primary key field, the source worksheet or range must have a column that contains values that are compatible with the primary key field, and the imported key values must be unique. If an imported record contains a primary key value that already exists in the destination table, the import operation displays an error message.
-
Indexed fields    If the Indexed property of a field in the table is set to Yes (No Duplicates), the corresponding column in the source worksheet or range must contain unique values.
Go to the next steps to run the import operation.
-
Start the import operation
-
The location of the import/link wizard differs slightly depending upon your version of Access. Choose the steps that match your Access version:
-
If you're using the latest version of the Microsoft 365 , Access 2021, or Access 2019, on the External Data tab, in the Import & Link group, click New Data Source > From File > Excel.
-
If you're using Access 2016, on the External Data tab, in the Import & Link group, click Excel.
Note:Â The External Data tab is not available unless a database is open.
-
-
In the Get External Data - Excel Spreadsheet dialog box, in the File name box, specify the name of the Excel file that contains the data that you want to import.
-or-
Click Browse and use the File Open dialog box to locate the file that you want to import.
-
Specify how you want to store the imported data.
To store the data in a new table, select Import the source data into a new table in the current database. You will be prompted to name this table later.
To append the data to an existing table, select Append a copy of the records to the table and select a table from the drop-down list. This option is not available if the database has no tables.
To link to the data source by creating a linked table, see the section Link to data in Excel, later in this article.
-
Click OK.
The Import Spreadsheet Wizard starts, and leads you through the import process. Go to the next set of steps.
Use the Import Spreadsheet wizard
-
On the first page of the wizard, select the worksheet that contains the data that you want to import, and then click Next.
-
On the second page of the wizard, click either Show Worksheets or Show Named Ranges, select either the worksheet or the named range that you want to import, and then click Next.
-
If the first row of the source worksheet or range contains the field names, select First Row Contains Column Headings and click Next.
If you are importing the data into a new table, Access uses these column headings to name the fields in the table. You can change these names either during or after the import operation. If you are appending the data to an existing table, ensure that the column headings in the source worksheet exactly match the names of the fields in the destination table.
If you are appending data to an existing table, skip directly to step 6. If you are adding the data to a new table, follow the remaining steps.
-
The wizard prompts you to review the field properties. Click a column in the lower half of the page to display the corresponding field's properties. Optionally, do any of the following:
-
Review and change, if you want, the name and data type of the destination field.
Access reviews the first eight rows in each column to suggest the data type for the corresponding field. If the column in the worksheet contains different types of values, such as text and numbers, in the first eight rows of a column, the wizard suggests a data type that is compatible with all the values in the column — most often, the text data type. Although you can choose a different data type, remember that values that are incompatible with the data type that you choose will be either ignored or converted incorrectly during the import process. For more information about how to correct missing or incorrect values, see the section Troubleshoot missing or incorrect values, later in this article.
-
To create an index on the field, set Indexed to Yes.
-
To completely skip a source column, select the Do not import field (Skip) check box.
Click Next after you finish selecting options.
-
-
In the next screen, specify a primary key for the table. If you select Let Access add primary key, Access adds an AutoNumber field as the first field in the destination table, and automatically populates it with unique ID values, starting with 1. Click Next.
-
In the final wizard screen, specify a name for the destination table. In the Import to Table box, type a name for the table. If the table already exists, Access displays a prompt that asks whether you want to overwrite the existing contents of the table. Click Yes to continue or No to specify a different name for the destination table, and then click Finish to import the data.
If Access was able to import some or all the data, the wizard displays a page that shows you the status of the import operation. In addition, you can save the details of the operation for future use as a specification. Conversely, if the operation completely failed, Access displays the message An error occurred trying to import file.
-
Click Yes to save the details of the operation for future use. Saving the details helps you repeat the operation at a later time without having to step through the wizard each time.
See Save the details of an import or export operation as a specification to learn how to save your save your specification details.
See Run a saved import or export specification to learn how to run your saved import or link specifications.
See Schedule an import or export specification to learn how to schedule import and link tasks to run at specific times.
Troubleshoot missing or incorrect values
If you receive the message An error occurred trying to import file, the import operation completely failed. Conversely, if the import operation displays a dialog box that prompts you to save the details of the operation, the operation was able to import all or some of the data. The status message also mentions the name of the error log table that contains the description of any errors that occurred during the import operation.
Important:Â Even if the status message indicates a completely successful operation, you should review the contents and structure of the table to ensure that everything looks correct before you start using the table.
-
Open the destination table in Datasheet view to see whether all data was added to the table.
-
Open the table in Design view to review the data type and other property settings of the fields.
The following table describes the steps that you can take to correct missing or incorrect values.
Tip:Â While you are troubleshooting the results, if you find just a few missing values, you can add them to the table manually. Conversely, if you find that entire columns or a large number of values are either missing or were not imported properly, you should correct the problem in the source file. After you have corrected all known problems, repeat the import operation.
Issue |
Resolution |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Graphical elements |
Graphical elements, such as logos, charts, and pictures cannot be imported. Manually add them to the database after completing the import operation. |
||||||||||||
Calculated values |
The results of a calculated column or cells are imported, but not the underlying formula. During the import operation, you can specify a data type that is compatible with the formula results, such as Number. |
||||||||||||
TRUE or FALSE and -1 or 0 values |
If the source worksheet or range includes a column that contains only TRUE or FALSE values, Access creates a Yes/No field for the column and inserts -1 or 0 values in the field. However, if the source worksheet or range includes a column that contains only -1 or 0 values, Access, by default, creates a numeric field for the column. You can change the data type of the field to Yes/No during the import operation to avoid this problem. |
||||||||||||
Multivalued fields |
When you import data to a new table or append data to an existing table, Access does not enable support for multiple values in a field, even if the source column contains a list of values separated by semicolon (;). The list of values is treated as a single value and is placed in a text field. |
||||||||||||
Truncated data |
If data appears truncated in a column in the Access table, try increasing the width of the column in Datasheet view. If that doesn't resolve the issue, the data in a numeric column in Excel is too large for the field size of the destination field in Access. For example, the destination field might have the FieldSize property set to Byte in an Access database but the source data contains a value greater than 255. Correct the values in the source file and try importing again. |
||||||||||||
Display format |
You might have to set the Format property of certain fields in design view to ensure that the values are displayed correctly in Datasheet view. For example:
Note:Â If the source worksheet contains rich text formatting such as bold, underline, or italics, the text is imported, but the formatting is lost. |
||||||||||||
Duplicate values (key violation error) |
Records that you are importing might contain duplicate values that cannot be stored in the primary key field of the destination table or in a field that has the Indexed property set to Yes (No Duplicates). Eliminate the duplicate values in the source file and try importing again. |
||||||||||||
Date values off by 4 years |
The date fields that are imported from an Excel worksheet might be off by four years. Excel for Windows can use two date systems:
You can set the date system in Excel Options: File > Options > Advanced > Use 1904 date system. Note    If you import from a .xlsb workbook, it always uses the 1900 Date System regardless of the Date System setting. Before you import the data, change the date system for the Excel workbook or, after appending the data, perform an update query that uses the expression [date field name] + 1462 to correct the dates. Excel for the Macintosh only uses the 1904 Date System. |
||||||||||||
Null values |
You might see an error message at the end of the import operation about data that was deleted or lost during the operation, or when you open the table in Datasheet view, you might see that some field values are blank. If the source columns in Excel are not formatted, or the first eight source rows contain values of different data types, open the source worksheet and do the following:
The preceding steps can help minimize the appearance of null values. The following table lists cases in which you will still see null values:
|
||||||||||||
Date values replaced by numeric values |
You will see seemingly random five-digit numbers instead of the actual date values in the following situations:
|
||||||||||||
Numeric values replaced by date values |
You will see seemingly random date values instead of the actual numeric values in the following situations:
To avoid this, replace the numeric values with date values in the source column and then try importing again. |
In addition, you might want to review the error log table (mentioned in the last page of the wizard) in Datasheet view. The table has three fields — Error, Field, and Row. Each row contains information about a specific error, and the contents of the Error field should help you troubleshoot the problem.
Error strings and troubleshooting hints
Error |
Description |
---|---|
Field Truncation |
A value in the file is too large for the FieldSize property setting for this field. |
Type Conversion Failure |
A value in the worksheet is the wrong data type for this field. The value might be missing or might appear incorrect in the destination field. See the previous table for more information how to troubleshoot this issue. |
Key Violation |
This record's primary key value is a duplicate — it already exists in the table. |
Validation Rule Failure |
A value breaks the rule set by using the ValidationRule property for this field or for the table. |
Null in Required Field |
A null value isn't allowed in this field because the Required property for the field is set to Yes. |
Null value in AutoNumber field |
The data that you are importing contains a Null value that you attempted to append to an AutoNumber field. |
Unparsable Record |
A text value contains the text delimiter character (usually double quotation marks). Whenever a value contains the delimiter character, the character must be repeated twice in the text file; for example: 4 1/2"" diameter |
Link to data in Excel
By linking an Access database to data in another program, you can use the querying and reporting tools that Access provides without having to maintain a copy of the Excel data in your database.
When you link to an Excel worksheet or a named range, Access creates a new table that is linked to the source cells. Any changes that you make to the source cells in Excel appear in the linked table. However, you cannot edit the contents of the corresponding table in Access. If you want to add, edit, or delete data, you must make the changes in the source file.
Common scenarios for linking to an Excel worksheet from within Access
Typically, you link to an Excel worksheet (instead of importing) for the following reasons:
-
You want to continue to keep your data in Excel worksheets, but be able to use the powerful querying and reporting features of Access.
-
Your department or workgroup uses Access, but data from external sources that you work with is in Excel worksheets. You don't want to maintain copies of external data, but want to be able to work with it in Access.
If this is the first time you are linking to an Excel worksheet
-
You cannot create a link to an Access database from within Excel.
-
When you link to an Excel file, Access creates a new table, often referred to as a linked table. The table shows the data in the source worksheet or named range, but it doesn't actually store the data in the database.
-
You cannot link Excel data to an existing table in the database. This means that you cannot append data to an existing table by performing a linking operation.
-
A database can contain multiple linked tables.
-
Any changes that you make to the data in Excel are automatically reflected in the linked table. However, the contents and structure of a linked table in Access are read-only.
-
When you open an Excel workbook in Access (in the File Open dialog box, change the Files of Type list box to Microsoft Excel, and select the file you want), Access creates a blank database and automatically starts the Link Spreadsheet Wizard.
Prepare the Excel data
-
Locate the Excel file and the worksheet or range that has the data you want to link to. If you don't want to link to the entire worksheet, consider defining a named range that includes only the cells you want to link to.
Create a named range in Excel (optional – useful if you only want to link to some of the worksheet data)  Â-
Switch to Excel and display the worksheet in which you want to define a named range.
-
Select the range of cells that contain the data you want to link to.
-
Right-click within the selected range and click Name a Range or Define Name.
-
In the New Name dialog box, specify a name for the range in the Name box and then click OK.
Note that you can link to only one worksheet or range at a time during a link operation. To link to data in multiple places in a workbook, repeat the link operation for each worksheet or range.
-
-
Review the source data, and take action as described in the following table:
Element
Description
Tabular format
Ensure that the cells are in tabular format. If the range includes merged cells, the contents of the cell are placed in the field that corresponds to the leftmost column and the other fields are left blank.
Skipping columns and rows
You cannot skip source columns and rows during the linking operation. However, you can hide fields and filter records by opening the linked table in Datasheet view after you have imported them into Access.
Number of columns
The number of source columns cannot exceed 255, because Access does not support more than 255 fields in a table.
Blank columns, rows, and cells
Delete all unnecessary blank columns and blank rows in the Excel worksheet or range. If there are blank cells, try to add the missing data.
Error values
If one or more cells in a worksheet or range contain error values, correct them before you start the import operation. Note that if a source worksheet or range contains error values, Access inserts a null value in the corresponding fields in the table.
Data type
You cannot change the data type or size of the fields in the linked table. Before you start the linking operation, you must verify that each column contains data of a specific type.
We highly recommend that you format a column if it includes values of different data types. For example, the FlightNo column in a worksheet might contain numeric and text values, such as 871, AA90, and 171. To avoid missing or incorrect values, do the following:
-
Right-click the column and then click Format Cells.
-
On the Number tab, under Category, select a format.
-
Click OK.
First row
If the first row in the worksheet or named range contains the names of the columns, you can specify that Access should treat the data in the first row as field names during the link operation. If there are no column names in the worksheet, or if a specific column name violates the field naming rules in Access, Access assigns a valid name to each corresponding field.
-
-
Close the source file, if it is open.
Prepare the destination database
-
Open the database in which you want to create the link. Ensure that the database is not read-only and that you have the necessary permissions to make changes to it.
-
If you don't want to store the link in any of your existing databases, create a blank database: Click the File tab, click New, and then click Blank Database.
You are now ready to start the linking operation.
Create the link
-
The location of the import/link wizard differs slightly depending upon your version of Access. Choose the steps that match your Access version:
-
If you're using the latest version of the Microsoft 365 subscription version of Access, Access 2021, or Access 2019, on the External Data tab, in the Import & Link group, click New Data Source > From File > Excel.
-
If you're using Access 2016 or Access 2013, on the External Data tab, in the Import & Link group, click Excel.
Note:Â The External Data tab is not available unless a database is open.
-
-
In the Get External Data - Excel Spreadsheet dialog box, in the File name box, specify the name of the Excel source file.
-
Select Link to the data source by creating a linked table, and then click OK.
The Link Spreadsheet Wizard starts and guides you through the linking process.
-
On the first page of the wizard, select a worksheet or a named range and click Next.
-
If the first row of the source worksheet or range contains the field names, select First row contains column headings. Access uses these column headings to name the fields in the table. If a column name includes certain special characters, it cannot be used as a field name in Access. In such cases, an error message is displayed that tells you that Access will assign a valid name for the field. Click OK to continue.
-
On the final page of the wizard, specify a name for the linked table and then click Finish. If the table with the name you specify already exists, you are asked if you want to overwrite the existing table or query. Click Yes if you want to overwrite the table or query, or click No to specify a different name.
Access tries to create the linked table. If the operation succeeds, Access displays the Finished linking table message. Open the linked table and review the fields and data to ensure that you see the correct data in all the fields.
If you see error values or incorrect data, you must troubleshoot the source data. For more information about how to troubleshoot error values or incorrect values, see the next section.
Troubleshoot #Num! and other incorrect values in a linked table
Even if you receive the message Finished linking table, you should open the table in Datasheet view to ensure that the rows and columns show the correct data.
If you see errors or incorrect data anywhere in the table, take correct action as described in the following table, and then try linking again. Remember that you cannot add the values directly to the linked table, because the table is read-only.
Issue |
Resolution |
---|---|
Graphical elements |
Graphical elements in an Excel worksheet, such as logos, charts, and pictures, cannot be linked to in Access. |
Display format |
You might have to set the Format property of certain fields in Design view to ensure that the values are displayed correctly in Datasheet view. |
Calculated values |
The results of a calculated column or cells are displayed in the corresponding field, but you cannot view the formula (or expression) in Access. |
Truncated text values |
Increase the width of the column in Datasheet view. If you still don't see the entire value, it could be because the value is longer than 255 characters. Access can only link to the first 255 characters, so you should import the data instead of linking to it. |
Numeric field overflow error message |
The linked table might appear to be correct, but later, when you run a query against the table, you might see a Numeric Field Overflow error message. This can happen because of a conflict between the data type of a field in the linked table and the type of data that is stored in that field. |
TRUE or FALSE and -1 or 0 values |
If the source worksheet or range includes a column that contains only TRUE or FALSE values, Access creates a Yes/No field for the column in the linked table. However, if the source worksheet or range includes a column that contains only -1 or 0 values, Access, by default, creates a numeric field for the column, and you will not be able to change the data type of the corresponding field in the table. If you want a Yes/No field in the linked table, ensure that the source column includes TRUE and FALSE values. |
Multivalued fields |
Access does not enable support for multiple values in a field, even if the source column contains a list of values separated by semicolon (;). The list of values will be treated as a single value, and placed in a text field. |
#Num! |
Access displays the #Num! error value instead of the actual data in a field in the following situations:
Do the following to minimize the instances of null values in the table:
|
Numeric values instead of date values |
If you see a seemingly random five-digit number in a field, check to see if the source column contains mostly numeric values but also includes a few date values. Date values that appear in numeric columns get incorrectly converted to a number. Replace the date values with numeric values and then try linking again. |
Date values instead of numeric values |
If you see a seemingly random date value in a field, check to see if the source column contains mostly date values but also includes a few numeric values. Numeric values that appear in date columns get incorrectly converted to a date. Replace the numeric values with date values and then try linking again. |