SQUIDD
Well-known Member
- Joined
- Jan 2, 2009
- Messages
- 2,126
- Office Version
- 2019
- 2016
- Platform
- Windows
Hello
i am trying to do call a macro if an error occours. Basically, the error is literally when the text file does not exist on a querytable, so when the .txt file does not exist i get an error, so i tried the below, but it does not bypass the error. it still displays the error message thet causes my long loop code to stop.
anyone know what i can do.
thanks
dave
i am trying to do call a macro if an error occours. Basically, the error is literally when the text file does not exist on a querytable, so when the .txt file does not exist i get an error, so i tried the below, but it does not bypass the error. it still displays the error message thet causes my long loop code to stop.
Code:
Sub LOAD_DAY()
On Error GoTo 0
With Range("'day'!A1").QueryTable
.Connection = "TEXT;C:\THERE OFF\DAYS\" & Range("'CHARTS'!U2").Text & ".txt"
.TextFileColumnDataTypes = Array(1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2)
.Refresh BackgroundQuery:=False
End With
Exit Sub
0: Call RUN_APP
End Sub
anyone know what i can do.
thanks
dave
Last edited: