DougRobertson
Active Member
- Joined
- Sep 22, 2009
- Messages
- 334
- Office Version
- 365
- Platform
- Windows
Hi,
In my macro, there is a segment where it will need to Kill (delete) a file if it exists. However if it does NOT exist, I just want it to skip that command.
It works fine when there is a file to delete, but when there isn't, it stops with an error message "Can't find the file name" or some such thing. I tried putting the ON ERROR RESUME NEXT code one line above it, which works on other applications, but not this one.
Is there another way or command to have the macro disregard the error message and just keep going?
Thanks,
~ Doug
In my macro, there is a segment where it will need to Kill (delete) a file if it exists. However if it does NOT exist, I just want it to skip that command.
It works fine when there is a file to delete, but when there isn't, it stops with an error message "Can't find the file name" or some such thing. I tried putting the ON ERROR RESUME NEXT code one line above it, which works on other applications, but not this one.
Is there another way or command to have the macro disregard the error message and just keep going?
Thanks,
~ Doug