Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default How to delete a file using VBA

I am sure this must be a really easy process but I have searched and
searched for an answer without success.

I need to include a command in an Excel macro which will delete a file.
The name of the file will vary each time the macro runs but the path,
filename and extension are held in a cell in the spreadsheet. Note that
the file that I want to delete is not the Excel file which is running
the macro and it is not an open file. (It is actually a .txt file in a
different directory.)

Can anybody tell me what the code is?

I am using Office XP on Windows XP and also on Windows 2000.

Thanks in advance.

Graham Standring
University of Sunderland
UK.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default How to delete a file using VBA

See the Kill Statement in VBA help.

Graham Standring wrote:
I am sure this must be a really easy process but I have searched and
searched for an answer without success.

I need to include a command in an Excel macro which will delete a file.
The name of the file will vary each time the macro runs but the path,
filename and extension are held in a cell in the spreadsheet. Note that
the file that I want to delete is not the Excel file which is running
the macro and it is not an open file. (It is actually a .txt file in a
different directory.)

Can anybody tell me what the code is?

I am using Office XP on Windows XP and also on Windows 2000.

Thanks in advance.

Graham Standring
University of Sunderland
UK.

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
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
how do i delete a file from recent documents file in excel exile New Users to Excel 1 March 7th 09 01:59 AM
delete info from source file w/out changing the destination file TB New Users to Excel 0 May 26th 08 06:26 PM
excel file deleted. Now howdo you delete file NAME NANMAC New Users to Excel 8 September 2nd 05 07:26 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 05:10 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"