Bulk Import only NEW txt files and append to existing table

rcamp

New Member
Joined
Mar 31, 2013
Messages
3
Hello,
Here is what I would like to do:
  1. Select a folder with multiple txt files (new txt files will be added weekly)
  2. Import NEW txt files (i.e. txt files that have not been imported before)
  3. Append the new txt files to an existing access table

I'm familiar with Access, but am very new to coding. Here is where I've gotten:

Sub ImportMod()
Dim f As Object '//File Object

With CreateObject("Scripting.FileSystemObject")
For Each f In .GetFolder("C:\ImportDir").Files
DoCmd.TransferText acImportDelim, "BufferDump", "ImportFile", f.Path, True 'import file
DoEvents 'don't take over all of the PC resources
Next f

End With


End Sub

Right now, all it does is look in a folder and import every single txt file in that folder and puts the data into a table called "ImportFile".

I would appreciate any help or direction. Thanks!!!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,214,863
Messages
6,121,978
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top