tranferspreadsheet, spreadsheet type error

RECrerar

Registered User.
Local time
Today, 11:39
Joined
Aug 7, 2008
Messages
130
Hi, I'm trying to automatically import an excel spreadsheet into Access using the following code.

Code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "tblTabs", "C:\Rpt_pjwk_post.xls", True

Problem is I keep getting the error "Runtime error 3274, external table is not in the expected format". I have Excel and Access 2003. The import works fine when I do it manually. I assume it is because I am specifying the wrong spreadhseet type but I have tried all the options (I think) and can't get any to work. If anyone can advise that would be great.

Thanks, Robyn
 
Doh! Okay ignore this post, the error was not with the code but with the spreadsheet I was trying to import, the download of data to it had failed misserably and hence was in a very unexpected format. Oops, should have checked that sooner
 

Users who are viewing this thread

Back
Top Bottom