ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening text files (https://www.excelbanter.com/excel-programming/293002-opening-text-files.html)

jason

Opening text files
 
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

Tom Ogilvy

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





All times are GMT +1. The time now is 12:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com