TransferSpreadsheet Question

JCollins

Registered User.
Local time
Today, 23:26
Joined
Dec 3, 2001
Messages
13
The data I have in my spreadsheet does not have a first row with the names of the fields. When I run this, it gives me a run-time error 2391 "Field F1 does not exist in table "testing"".

How do I make it accept the default names of the fields? When I manually added in the field names, and changed the HasFieldNames to True, it worked...Unfortunately, the data that comes to me does not have field names.

DoCmd.TransferSpreadsheet acImport, 8, "testing", _
"C:\Excel_StockLedger_Conversion.xls", False, "'TempHolding'!a:h"
 
Is there more than one worksheet in your Excel file? If there is more than one, try not using the range of cells. If it has only one worksheet, don't specify the worksheet name (this is the best option if it exists).

I really think that it doesn't like using RANGE data for importing when you don't have header information in the Excel file.

BL
hth
 

Users who are viewing this thread

Back
Top Bottom