Solved

Excel Import to Access

Posted on 2013-10-31
2
259 Views
Last Modified: 2013-10-31
Dear Experts

This is a really weird one ...  I am trying to import an excel spreadsheet into Access using the following code:

DoCmd.TransferSpreadsheet acImport, , "SMS Import", "C:\Users\xxxx\Desktop\SMS Import.xlsx"

Open in new window


I keep getting an error saying "Field F1 doesn't exist in destination table 'SMS Import'" - so to make sure I wasn't missing anything I exported the data that already existed in the table to excel and then tried to reimport it - I still got the same error!

Any ideas - I have tried adding a reference to Microsoft Excel 14.0 Object library as well as Microsoft Office 14.0 Object library - no difference though
0
Comment
Question by:correlate
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39614270
Hi,

pls try because of no field names
DoCmd.TransferSpreadsheet acImport, , "SMS Import", "C:\Users\xxxx\Desktop\SMS Import.xlsx", False

Open in new window

Regards
0
 

Author Closing Comment

by:correlate
ID: 39614285
perfect - thank you, I used true rather than false at the end as the spread sheet had headers & that did the trick
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question