Solved

Why Excel file import not working

Posted on 2015-01-31
6
125 Views
Last Modified: 2015-04-01
With Access 2013 I'm using this code to try to import an Excel file into a table but it isn't working.  Nothing happens.

        DoCmd.TransferSpreadsheet acImport, 10, "tblTempCatalogImport", Me.txtFileName, True


Note:  I have also tried:      
 
        'DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblTempCatalogImport", Me.txtFileName, True
       
        'DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "tblTempCatalogImport", Me.txtFileName, True


????
0
Comment
Question by:SteveL13
6 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
What is the format of the Excel file?

.xls
.xlsx
.xlsm
0
 
LVL 11

Expert Comment

by:Wilder1626
Comment Utility
Can you try like:

DoCmd.OutputTo acOutputTable, “tblTempCatalogImport”, acFormatXLS, , True
0
 

Author Comment

by:SteveL13
Comment Utility
Format is XLS
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
try without the constant


DoCmd.TransferSpreadsheet acImport, , "tblTempCatalogImport", Me.txtFileName, True
0
 
LVL 92

Expert Comment

by:Patrick Matthews
Comment Utility
Do you get an error?  If so, what is the error description?
0
 

Author Comment

by:SteveL13
Comment Utility
I'm not sure why but this ended up working when it didn't before:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblTempCatalogImport", Me.txtFileName, True
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

772 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

10 Experts available now in Live!

Get 1:1 Help Now