Hi all,
I am working on an Access database for a customer. There is a main form where the user selects a location of a file, clicks a button and the file is imported into a table in the database.
This file has extension .xls. So, I used the following code to import it:
Easy enough except I'm getting the Run-time error '3274': External table is not in the expected format.
So I attempt to open the Excel doc myself and I get a warning message "The file you are trying to open,'filename', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?" I click "Yes" and voila, the file opens and looks like a typical Excel file.
This file is provided weekly by a third party via email. The user saves it to a network location and then uses the Access database to work with the file. Is there any way I can import this into Access using VBA short of going to the third party and requesting they "fix" their file? No clue what is causing that error to begin with.
Thanks in advance for any suggestions!
Kelly
I am working on an Access database for a customer. There is a main form where the user selects a location of a file, clicks a button and the file is imported into a table in the database.
This file has extension .xls. So, I used the following code to import it:
Code:
DoCmd.TransferSpreadsheet acImport, , "JIT", txtJITReportFile, True, "A:M"
Easy enough except I'm getting the Run-time error '3274': External table is not in the expected format.
So I attempt to open the Excel doc myself and I get a warning message "The file you are trying to open,'filename', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?" I click "Yes" and voila, the file opens and looks like a typical Excel file.
This file is provided weekly by a third party via email. The user saves it to a network location and then uses the Access database to work with the file. Is there any way I can import this into Access using VBA short of going to the third party and requesting they "fix" their file? No clue what is causing that error to begin with.
Thanks in advance for any suggestions!
Kelly