Ok, Boyd , but how should look the error handling code from Func1 to stop execution if an error ocured in Proc1(which is a function now, let's say Func2)?
Whith the code below, every time I get an error in Func2 (let's say that one of the .txt files doesn't exist) the application continue to run and import the rest of the files.
On Error GoTo ErrHandle
---some code to select a file from a folder
Set ExcelWorkbook = Nothing
Set ExcelApp = Nothing
---code to import .txt file.