Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete a file in code
How to delete a file in code? I dont want to be asked if i wanted or not to
do it |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete a file in code
Look up "Kill" in the Help.
NickHK "aidan" wrote in message ... How to delete a file in code? I dont want to be asked if i wanted or not to do it |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete a file in code
Try:
sub DeleteFile() Application.DisplayAlerts =False If Dir("C:\my documents\File Name to be Deleted.xls") < "" Then _ Kill "C:\my documents\File Name to be Deleted.xls" Application.DisplayAlerts = True end sub Regards Corey |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete a file in code
If you want to permanently and completely delete the file, use the Kill
statement. Note that Kill does not send the file to the Recycle Bin. The file is gone forever. If you want to delete the file, but put it in to the Recycle Bin, use the code on http://www.cpearson.com/excel/recycle.htm . -- Cordially, Chip Pearson Microsoft MVP - Excel www.cpearson.com (email address is on the web site) "aidan" wrote in message ... How to delete a file in code? I dont want to be asked if i wanted or not to do it |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
code to delete module / macro in another file | Excel Discussion (Misc queries) | |||
Code to delete an Excel File | Excel Discussion (Misc queries) | |||
save and delete a file when in it with code | Excel Programming | |||
code to delete a file | Excel Programming | |||
i need help making code that will open an Xml file for Excel in VB.NET and delete tables that i don't want to show up | Excel Programming |