could you plz explain more since Am a new fish in this field, and it will be great if provide some instructions on where to place the code.
thank you for your replay
To see what my code does, you should learn Perl. The relevant documentation is in perlrun, sleep and unlink.
But you need to realize that your task is foolish and easily circumvented, because there is no way to make an Excel file self-destruct that the user couldn't easily prevent, for example by making a copy of the file before opening it.