Welcome toExcel.Tips.Net
Tips.Net Home
ExcelTips Home
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Learn Access Now
Free Printable Forms
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site
Adding a Little Animation to Your Life
Converting a Range of URLs to Hyperlinks
Making the Formula Bar Persistent
Sometimes you may use a macro to create temporary files which you later need to delete. Similarly, you may need to just delete a file within a macro. You can accomplish this task using the Kill command. This is a holdover from other versions of BASIC. The syntax is:
Kill File
where File is the full path and file name of the file you want to delete. When you delete a file in this manner, the file is not moved to the Windows Recycle bin; instead, it is immediately deleted from your drive.
If desired, you can also use wildcard characters in the File specification. For instance, if you wanted to delete all the files in the current directory that end in the TMP extension, you could use a command like this:
Kill "*.tmp"
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2450) applies to Microsoft Excel versions: 97 2000 2002 2003 2007
Save Time! ExcelTips has been published weekly since late 1998. Past issues of ExcelTips are available in convenient ExcelTips archives. Have your own enhanced archive of ExcelTips at your fingertips, available to use at any time!