Solved

Import Excel Using Saved Import

Posted on 2013-01-11
3
274 Views
Last Modified: 2013-01-14
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.
0
Comment
Question by:Buck_Beasom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 38768626
first import the excel file and do all the necessary steps

select save the import

after you have done this you can use


docmd.RunSavedImportExport(SavedImportExportName)


the other method is

docmd.transferspreadsheet acimport, 10,"Ledger_Import", strFileName, true
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38768941
<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.
0
 

Author Closing Comment

by:Buck_Beasom
ID: 38774156
As usual, Capricorn1 gets me right out of the woods on the first try!
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question