Solved

Why Excel file import not working

Posted on 2015-01-31
6
128 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)
ID: 40581508
What is the format of the Excel file?

.xls
.xlsx
.xlsm
0
 
LVL 11

Expert Comment

by:Wilder1626
ID: 40581509
Can you try like:

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

Author Comment

by:SteveL13
ID: 40581514
Format is XLS
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 40581516
try without the constant


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

Expert Comment

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

Author Comment

by:SteveL13
ID: 40581542
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Tags from access to excel 3 32
Close Print Preview button not active 12 36
From msAccess  SaveAs an excel file SILENTLY without opening excel 4 31
word 2016 1 0
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

863 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

20 Experts available now in Live!

Get 1:1 Help Now