MrManBoy
New Member
- Joined
- May 28, 2014
- Messages
- 37
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
Hi Team,
I have the below code to delete these particular workbooks for example, however, in the case the user runs the below macro again & the file(s) have been deleted already, I would like to learn how one could stop the macro and then have a message displaying something like "Files have already been deleted" for example.
Thank you in advance to anyone who can help me out with this issue.
I have the below code to delete these particular workbooks for example, however, in the case the user runs the below macro again & the file(s) have been deleted already, I would like to learn how one could stop the macro and then have a message displaying something like "Files have already been deleted" for example.
Code:
Sub DeleteWorkbooks()
Kill "E:\Steve's Stuff\Docs\Paul Test\HR.xlsx"
Kill "E:\Steve's Stuff\Docs\Paul Test\HW.xlsx"
End Sub
Thank you in advance to anyone who can help me out with this issue.