Opening text files

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Hello folks,

I have created a macro that opens several .txt files and
saves them as excel. Is it possible to put code within
the macro that will skip to the next txt file if the
current txt file within the array is not in the folder yet
(i.e. - not all txt files are copied to folder at once,
they appear over time, I want to run the macro at specific
times, even if all txt files are not there)

Thanks,

Jason
 
set wbk = Nothing
On error resume next
wb = Workbooks.Open( filename:=namearray(i))
On Error Resume Next
if not wb is nothing then

' process text file.

End if
 
Back
Top