• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

Why Excel file import not working

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

1 Solution
Dale FyeCommented:
What is the format of the Excel file?

Can you try like:

DoCmd.OutputTo acOutputTable, “tblTempCatalogImport”, acFormatXLS, , True
SteveL13Author Commented:
Format is XLS
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Rey Obrero (Capricorn1)Commented:
try without the constant

DoCmd.TransferSpreadsheet acImport, , "tblTempCatalogImport", Me.txtFileName, True
Patrick MatthewsCommented:
Do you get an error?  If so, what is the error description?
SteveL13Author Commented:
I'm not sure why but this ended up working when it didn't before:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblTempCatalogImport", Me.txtFileName, True
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now