View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Opening text files

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

--
Regards,
Tom Ogilvy


"Jason" wrote in message
...
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