I've made a procedure that creates a directory structure according to a textfile. It works perfectly fine, except there are some files that it can't create (long story).
I've built an error handler to record which files can't be made and then to continue building the rest of the files, but the problem is that when an error occurs the first time, it is recorded fine but the next time an error occurs, VB
pops up a runtime error instead of going to MockErr1.
How can I solve this so that it will always go to MockErr1?
Here's part of the codeVB Code:
Private Sub MakeIt() On Error GoTo MockErr1 'This is for stubborn filenames Open App.Path & "\Mock Systems\" & lstTrees.Text & "\" & Trees(i) For Output As #90 'Create the file Print #90, "Blah" Close #90 Exit Sub MockErr: MsgBox Err.Description MockErr1: 'Error occured during construction of dir structure Open App.Path & "\Mock Systems\" & lstTrees.Text & "\Err.txt" For Append As #78 Print #78, "'" & Err.Description & "' {" & Err.Number & "}" & " [" & Trees(i) & "]" Close #78 Err.Clear GoTo DoStats End Sub




Reply With Quote