I am using a for loop to open and convert data.
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\All Users.WINDOWS\Documents\sciencefair\Wind data\06\" & date8 & "\" & i & ".dat", _
Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
Array(Array(0, 1), Array(4, 1), Array(8, 1), Array(12, 1), Array(15, 1), Array(19, 1), _
Array(22, 1), Array(26, 1), Array(30, 1), Array(34, 1), Array(38, 1), Array(42, 1), Array( _
46, 1), Array(53, 1), Array(58, 1), Array(64, 1), Array(68, 1))
^ That works fine, but the problem is there ARE some data files missing. I want to somehow make the for loop continue on to check for the next one if it can't find the file. I know I can usually use "On Error Resume Next" but with this, it doesn't work. If I put it before the open part, it doesn't see any errors and continues on and messes up. If I put "On Error Resume Next" after the workbooks.opentext... I still get a popup saying it can't find the file and I can either end or debug. Any suggestions? Thanks.
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\All Users.WINDOWS\Documents\sciencefair\Wind data\06\" & date8 & "\" & i & ".dat", _
Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
Array(Array(0, 1), Array(4, 1), Array(8, 1), Array(12, 1), Array(15, 1), Array(19, 1), _
Array(22, 1), Array(26, 1), Array(30, 1), Array(34, 1), Array(38, 1), Array(42, 1), Array( _
46, 1), Array(53, 1), Array(58, 1), Array(64, 1), Array(68, 1))
^ That works fine, but the problem is there ARE some data files missing. I want to somehow make the for loop continue on to check for the next one if it can't find the file. I know I can usually use "On Error Resume Next" but with this, it doesn't work. If I put it before the open part, it doesn't see any errors and continues on and messes up. If I put "On Error Resume Next" after the workbooks.opentext... I still get a popup saying it can't find the file and I can either end or debug. Any suggestions? Thanks.