Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Delete File in a folder

Hi all, i save a file to a folder using a certain name and after i have
finished with it and closed it i need to delete it. I have played with
some code but just cannot get it to work. Could somebody help me out of
my misary please !!

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Delete File in a folder

Set fs = CreateObject("Scripting.FileSystemObject")
Set obj = fs.GetFile("your-file-name")
obj.Delete

"Les Stout" wrote in message
...
Hi all, i save a file to a folder using a certain name and after i have
finished with it and closed it i need to delete it. I have played with
some code but just cannot get it to work. Could somebody help me out of
my misary please !!

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete File in a folder

If you want to use the built in VBA capabilities:

Kill "C:\MyFolder\MyFile.xls"


--
Regards,
Tom Ogilvy

"Les Stout" wrote in message
...
Hi all, i save a file to a folder using a certain name and after i have
finished with it and closed it i need to delete it. I have played with
some code but just cannot get it to work. Could somebody help me out of
my misary please !!

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Delete File in a folder


Kill full_filename_including_path

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Les Stout" wrote in message
...
Hi all, i save a file to a folder using a certain name and after i have
finished with it and closed it i need to delete it. I have played with
some code but just cannot get it to work. Could somebody help me out of
my misary please !!

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Delete File in a folder

Thanks Bob and Tom, have a great weekend.

best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
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
Time based file/folder delete don Excel Discussion (Misc queries) 1 March 30th 09 02:20 PM
Need code to save file to new folder, erase from old folder Ron M. Excel Discussion (Misc queries) 1 February 24th 06 06:02 PM
open file from folder save in new folder tim64[_3_] Excel Programming 20 June 17th 05 07:58 PM
Create Folder and Text File in folder Todd Huttentsine Excel Programming 2 April 29th 04 03:41 PM
fso delete folder shockley Excel Programming 5 December 24th 03 04:43 PM


All times are GMT +1. The time now is 03:36 AM.

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"