Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Cannot Import Spreadsheet If Field Name Begins with Space


View products that this article applies to.

Symptoms

When you try to import a Microsoft Excel spreadsheet into a Microsoft Access database, you may receive the following error message:
An error occurred trying to import file '<File Name>'. The file was not imported.

↑ Back to the top


Cause

The error occurs if there is a space preceding one or more of the field names in the spreadsheet.

↑ Back to the top


Resolution

You can resolve the error in the following ways:
  • Open the spreadsheet in Microsoft Excel and remove the leading space from the field name.
  • Link the spreadsheet in Microsoft Access instead of importing it.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

Steps to Reproduce Problem

  1. Start Microsoft Excel and create the following spreadsheet. Type a space in front of the word "Cost":
       Item           <space>Cost       Quantity
       a                   25              2
       b                   23              8
    					
  2. Save the file as C:\My Documents\TestSpace.xls, and then quit Microsoft Excel.
  3. Start Microsoft Access and open the sample database Northwind.mdb.
  4. On the File menu, point to Get External Data, and then click Import.
  5. In the Import dialog box, select Microsoft Excel (*.xls) in the Files Of Type box, and then click TestSpace.xls. Click Import.
  6. Click Next in the first dialog box of the Import Spreadsheet Wizard.
  7. In the Does the first row specified contain column headings? dialog box, click First Row Contains Column Headings, and then click Finish. Note that you receive the error message.

    To resolve the error, open TestSpace.xls in Microsoft Excel and remove the space in front of the word "Cost." Then repeat steps 2 through 7 and note that the error does not occur.

↑ Back to the top


References

For more information about importing data, click Microsoft Access Help on the Help menu, type import data in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Article Info
Article ID : 207878
Revision : 2
Created on : 1/1/0001
Published on : 1/1/0001
Exists online : False
Views : 356