Solved

Excel Import to Access

Posted on 2013-10-31
2
250 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 48

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 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

12 Experts available now in Live!

Get 1:1 Help Now