The information in this article applies to:
Moderate: Requires basic macro, coding, and interoperability skills. SYMPTOMSWhen you use the TransferSpreadsheet macro action or TransferSpreadsheet Visual Basic method to import a Microsoft Excel spreadsheet that contains numeric field names, the fields in the new table are named F1, F2, F3, and so on. RESOLUTIONUse either of the following methods to work around this behavior. Method 1: Change Field Names in Microsoft ExcelIf you want to use the TransferSpreadsheet action or method to import a Microsoft Excel file that contains numeric field names, you must change the field names in Microsoft Excel so that they are non-numeric. It is not enough to format the cells as text in Microsoft Excel. You must change the field names or precede the numbers with one or more non-numeric characters, such as a letter of the alphabet or an underscore (_).NOTE: You cannot use a space as the first character of the field name. If you format the field name as Text in Microsoft Excel, and then you use a space as the first character of the field name in an attempt to preserve its numeric name, you receive the following error message when you try to import the file:
Method 2: Use the Import Spreadsheet WizardTo use the Import Spreadsheet Wizard, follow these steps:
MORE INFORMATIONSteps to Reproduce BehaviorThe following example uses the TransferSpreadsheet action in a macro. You can also reproduce this behavior if you use the TransferSpreadsheet method of the DoCmd object in Visual Basic code.
REFERENCESFor more information about using the TransferSpreadsheet action or method, click Microsoft Access Help on the
Help menu, type "transferspreadsheet action" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic. Additional query words: fieldname
Keywords : kbdta IsmOthr IsmExl5 |
Last Reviewed: July 15, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |