#1   Report Post  
kizzie
 
Posts: n/a
Default How to delete file


Hello,

How do I delete a file with a macro?
de


thx


--
kizzie
------------------------------------------------------------------------
kizzie's Profile: http://www.excelforum.com/member.php...o&userid=26092
View this thread: http://www.excelforum.com/showthread...hreadid=394483

  #2   Report Post  
dominicb
 
Posts: n/a
Default


Good morning Kizzie

Use this:

Kill "C:\Thisfile.xls"

Please note that this will not send the file to the recycle bin (this
can't be done without resorting to Windows API calls) but will
completely delete it.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=394483

  #3   Report Post  
kizzie
 
Posts: n/a
Default


thanks al lot :)


--
kizzie
------------------------------------------------------------------------
kizzie's Profile: http://www.excelforum.com/member.php...o&userid=26092
View this thread: http://www.excelforum.com/showthread...hreadid=394483

  #4   Report Post  
Amedee Van Gasse
 
Posts: n/a
Default

In , kizzie told
us an interesting story. My reply to this story is at the bottom of
this message.


Hello,

How do I delete a file with a macro?
de


thx


According to the MSDN Library, there are 2 ways to delete a file:


FSO.DeleteFile(TestFilePath & "\Beatles\OctopusGarden.txt")

Set File = FSO.GetFile(TestFilePath & "\Beatles\BathroomWindow.txt")
File.Delete


FSO, as you might have guessed, has to be declared as a
FileSystemObject. GIYF for the gritty details.

--
Amedee Van Gasse
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel file deleted. Now howdo you delete file NAME NANMAC New Users to Excel 8 September 2nd 05 07:26 AM
Can't find macro in an Excel file to delete it Ron Excel Discussion (Misc queries) 3 July 1st 05 01:07 PM
"Delete sheet" not an available option on File menu. cj6855 Excel Worksheet Functions 1 June 10th 05 09:22 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
How do I Delete a file from the drop down file menu? Sander Excel Worksheet Functions 2 November 6th 04 05:05 PM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"