The On Error Resume Next statement cancels the error state before continuing, so the error will not be reported.
The On Error Goto 0 is not executed, but instead replaces the On Error Resume Next and will control the remainder of the code in the Function unless it also is replaced.
Removing the On Error Resume Next statement, and moving the On Error Goto 0 to before the Kill statement could give you what you are looking for.
-- Rookie
I see I should have written my situation a bit clearer.
The code I am running imports the data from
Text.txt, after it imports the data it will delete the file. If someone else is looking at the file then I want the code to skip the delete command (and since the file will be open if someone is reading it, it is unable to delete the file, so it will give me an error, and using the
On Error Resume Next it will just end up skipping the delete command) and move on with the code without me receiving an error.
Then I reset the On Error to
On Error GoTo 0 to catch any unseen errors later in my code.
And my problem is that even when I use the
On Error Resume Next to suppress the error I should receive if someone has it open, I still recieve a
'Runtime Error 70' when I execute the
Kill x command with how it is written above.
Hope that clears up my horribly written initial question.