Link to home
Start Free TrialLog in
Avatar of Buck Beasom
Buck BeasomFlag for United States of America

asked on

Import Excel Using Saved Import

I'm trying to import an Excel file into a Table in my application using

DoCmd.TransferSpreadsheet , , "Ledger_Import", strFileName

It is giving me an error that says "F1 is not in Ledger_Import" but there is no F1 column heading in the Excel sheet. Can I use a saved import specification to identify which columns are text and which are numbers and to make the upload go smoothly? Any other suggestions welcomed.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<No Points wanted>

"F1" means "Field1", ...a generic name for the field if you forget to use the HasFieldNames argument of the TransferSpreadheet Action...
...or if the data has no field names.

So capricorn1's syntax will work just fine for you.

See the VBA Help Files for the TransferSpreadsheet Action/Method, ...for more detailed information.
Avatar of Buck Beasom

ASKER

As usual, Capricorn1 gets me right out of the woods on the first try!