Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 207878 - Last Review: July 16, 2004 - Revision: 1.1
ACC2000: Cannot Import Spreadsheet If Field Name Begins with Space
This article was previously published under Q207878
Moderate: Requires basic macro, coding, and interoperability skills.
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.
The error occurs if there is a space preceding one or more of the field
names in the spreadsheet.
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.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Steps to Reproduce Problem
- 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
- Save the file as C:\My Documents\TestSpace.xls, and then quit Microsoft Excel.
- Start Microsoft Access and open the sample database Northwind.mdb.
- On the File menu, point to Get External Data, and then click Import.
- In the Import dialog box, select Microsoft Excel (*.xls) in the Files Of Type box, and then click TestSpace.xls. Click Import.
- Click Next in the first dialog box of the Import Spreadsheet Wizard.
- 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.
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.
APPLIES TO
- Microsoft Access 2000 Standard Edition
| kberrmsg kbbug kbnofix kbinterop KB207878 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
|
Patrick McKelvey
- pat.mckelvey NOSPAM-AT-NOSPAM reichhold.com
|
Report As Irrelevant
|
| Written:
11/10/2004 4:41 PM |
|
|