Solved

Excel Import to Access

Posted on 2013-10-31
2
254 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
2 Comments
 
LVL 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

864 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now