Importing data problems from Excel

T

TerryM

Ok, here's my issue.

I have a rather complicated process, at least I think it's complicated: This
is all run at startup of a Access 2003 DB file that I am hoping to upgrade
to a SQL 2005 Database.

This part is done in Excel using VBA code It downloads a .txt file from the
internet and parses out about 112 rows and 4 columns of data out of about
7000 rows and 10 columns in excel, it then pastes the parsed rows to a new
excel workbook and saves the file as temp.xls and then closes the Excel
application.

MS Access: It then does a docmd.import statement to import the parsed
information from the temp.xls file. Oh, I forgot to mention that the areas
in the txt file that are parsed out are 2 named ranges that are named in the
VBA code in an excel macro. Back to my problem, when I import the Excel
Worksheet (A1:D112) it imports (A2:D112). Also sometimes it doesn't import
all the rows. I might only get half of them. But it never imports the first
row at all. Why is it doing this?
 
J

Jim Burke in Novi

My guess would be that you are using an import specification that says the
first row is a heading row. That's the only reason I know of that the first
row would be skipped. Not sure if you can edit Import Specs or if you would
have to create a new one that tells Access not to treat the first row as a
headings.
 
K

Ken Snell \(MVP\)

Use the DoCmd.TransferSpreadsheet action to import the data from the EXCEL
worksheet. Be sure to specify False for the argument that identifies if the
first row contains header data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top