Also you are trying to open .dat file but the code is selecting a .csv file
hope this help
See clear as mud
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
I do not have a solution for your VBA code that fails to find an existing file, but I would add code for testing to see if several attempts at getting access to the file succeed. The test code uses the DIR command prior to opening the text file, and if the file is not found, makes 2 more attempts at finding the file. You may want to exit, as I have coded it, or continue in the procedure if DIR fails to locate the file.
This test process may give you some insight into what is going on: does the DIR test always succeed and Workbooks.OpenText still occasionally fail? Does using the DIR command clear up the problem completely? I guess there is no logical reason why it should, but running VBA code 100s of times and seeing it fail occasionally might need an illogical workaround.
Dim Newfile As String
Dim x As Integer
Newfile = Range("H2").Value 'H2 = C:\LSicom\Raw\03611\P06_0030.dat
x = 0
While Dir(Newfile) = ""
Application.Wait (Now + TimeValue("0:00:01"))
x = x + 1
If x > 2 Then
MsgBox "Could not find this file: " & Newfile