Good afternoon! I have an Excel workbook saved on a network path with a name that appends the current date and time in order to make it unique when created. For example, File 20150417130046.xlsm. As of now, an approver goes into said file and double clicks a cell which automatically appends an approval, saves as a PDF to another drive for processing, and then closes the file. The Excel file is no longer needed after the approval, so it needs to be deleted. We would like to eliminate the risk of manually deleting the wrong file by creating a macro that will automatically delete the Excel file after the PDF is created.
If the file name was static and could be defined, I could run a macro from a separate file (file 2) in order to delete said static file name (file 1). I'm familar with defining names as strings and referencing them later, but then I'm not sure how to take a defined name from the source file (ie the file to be deleted / file 1) and using that name in the macrofile that would perform the termination (file 2).
It is possible to run the kill command, or some kind of self-destruct command, from a macro in the file that I want to delete (ie delete itsself)?
- OR -
Can someone please advise me on how to define the name in file 1 and use that defined name in file 2 in order to delete file 1?
Thanks so much!