importing excel files into access table

M

Mike

I am working with an access database and about 1000 excel files. What I need
to do is import these xls files into an access database. I will be importing
all the files to the same table and I want to add to the data in the table.
In addition, is it possible to check for duplicates before importing? There
are several excel files that have duplicate rows. Column A is the
order_number column in the xls files. So I do not want to duplicate rows or
order_numbers when importing the xls files to the access table if I can help
it. I do not want to import duplicates based on column A if possible, but I
guess I could get them out later if this cannot be done. I really don't know
where to start with the macros, modules or vba's. The xls files all have the
same header info and there is only one sheet per xls file. I found this info
below on another post, but I am not sure how to get it to work, or if it will
even work in my situation.


Dim strFile As String
Dim strFolder As String

strFolder = "H:\Reporting\OrdersWaitingFraud\XL\"
strFile = Dir$(strFolder & "*.xls")
Do While Len(strFile) 0

' put your code here to use the TransferText method
' The full path to the file will be strFolder & strFile

strFile = Dir$()
Loop


Thanks a lot!
 

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