Runtime error 31519 occuring at DoCmd.TransferText

rcamp

New Member
Joined
Mar 31, 2013
Messages
3
Hello,
This code worked just fine a couple days ago, now all of a sudden I get the 31519 runtime error.
Code:
Private Sub Command8_Click()
Dim f As Object

With CreateObject("Scripting.FileSystemObject")
    For Each f In .GetFolder("C:\ImportDir").Files
        DoCmd.TransferText acImportDelim, "BufferDump", "ImportFile", f.Path, True
        DoEvents
    Next f

End With
End Sub

I've been finding in different forums that other people fixed this problem easily; however, none of those solutions are working. The debugger stops at the DoCmd line.

I appreciate any help or direction, thanks.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
One strange thing is that the code appears to run fine other than the error. It brings in all the text files and puts them in the table correctly.
 
Upvote 0

Forum statistics

Threads
1,214,946
Messages
6,122,401
Members
449,081
Latest member
JAMES KECULAH

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