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


????
SteveL13Asked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
try without the constant


DoCmd.TransferSpreadsheet acImport, , "tblTempCatalogImport", Me.txtFileName, True
0
 
Dale FyeCommented:
What is the format of the Excel file?

.xls
.xlsx
.xlsm
0
 
Wilder1626Commented:
Can you try like:

DoCmd.OutputTo acOutputTable, “tblTempCatalogImport”, acFormatXLS, , True
0
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.

 
SteveL13Author Commented:
Format is XLS
0
 
Patrick MatthewsCommented:
Do you get an error?  If so, what is the error description?
0
 
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
0
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.

All Courses

From novice to tech pro — start learning today.