Solved

Why Excel file import not working

Posted on 2015-01-31
6
133 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

856 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