Hi, I have problem with On Error statement
When I use my code sometimest there is no file that I need (StrFilename2, and StrFilename3) and I need an error statement. First statement works ok (On Error GoTo line1), but second not (On Error GoTo Line2), could you tell me where is problem from this part of my code?
I will be grateful for your response
Jan
If ....
code....
Else
On Error GoTo line1
UnpackFold = UnzipFold(StrFilename)
StrFilename2 = UnpackFold & "file.docx"
Open StrFilename2 For Input As #iFile
Do Until EOF(1)
Input #1, strTextLine
Debug.Print "strTextLine : " & " " & strTextLine
Loop
Close #iFile
line1:
On Error GoTo line2
StrFilename3 = UnpackFold & "file2.docm"
Open StrFilename3 For Input As #iFile
Do Until EOF(1)
Input #1, strTextLine
Debug.Print "strTextLine : " & " " & strTextLine
Loop
Close #iFile
line2:
MsgBox "Do not recognize extension"
End If