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

I have a spreadsheet with the pathname of the files that I want deleted,
anyway to do this in a macro? So much of what I have done is already
automated, this is one of the final steps in this project.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Delete Excel File

use KILL command

"Richard" wrote:

I have a spreadsheet with the pathname of the files that I want deleted,
anyway to do this in a macro? So much of what I have done is already
automated, this is one of the final steps in this project.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Delete Excel File

' Assume TESTFILE is a file containing some data.
Kill "TestFile" ' Delete file.

' Delete all *.TXT files in current directory.
Kill "*.TXT"



"Richard" wrote:

I have a spreadsheet with the pathname of the files that I want deleted,
anyway to do this in a macro? So much of what I have done is already
automated, this is one of the final steps in this project.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Delete Excel File

I tried what you suggested, however still being a novice, I am making some
error, the following is my code:

Sub Deletes()
'
' Delete Macro
' Macro recorded 8/22/2006 by RSabbara
'

'
Kill
Path = "C:"
With ActiveWorkbook
Workbooks.Open Filename:=Path & .Worksheets("Sheet1").Range("B11").Value &
".xls"

End Sub


What am I missing?

Thank you.

Richard

"Muhammed Rafeek M" wrote:

' Assume TESTFILE is a file containing some data.
Kill "TestFile" ' Delete file.

' Delete all *.TXT files in current directory.
Kill "*.TXT"



"Richard" wrote:

I have a spreadsheet with the pathname of the files that I want deleted,
anyway to do this in a macro? So much of what I have done is already
automated, this is one of the final steps in this project.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Delete Excel File

Try this one
Sub Deletes()
dim strFN as string

strFN = "C:\" & ActiveWorkbook .Worksheets("Sheet1").Range("B11").Value &
".xls"
Kill strFN

End Sub


"Richard" wrote:

I tried what you suggested, however still being a novice, I am making some
error, the following is my code:

Sub Deletes()
'
' Delete Macro
' Macro recorded 8/22/2006 by RSabbara
'

'
Kill
Path = "C:"
With ActiveWorkbook
Workbooks.Open Filename:=Path & .Worksheets("Sheet1").Range("B11").Value &
".xls"

End Sub


What am I missing?

Thank you.

Richard

"Muhammed Rafeek M" wrote:

' Assume TESTFILE is a file containing some data.
Kill "TestFile" ' Delete file.

' Delete all *.TXT files in current directory.
Kill "*.TXT"



"Richard" wrote:

I have a spreadsheet with the pathname of the files that I want deleted,
anyway to do this in a macro? So much of what I have done is already
automated, this is one of the final steps in this project.



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 locked and cannot delete file Simka Excel Discussion (Misc queries) 7 May 12th 09 10:46 AM
how do i delete a file from recent documents file in excel exile New Users to Excel 1 March 7th 09 01:59 AM
excel file deleted. Now howdo you delete file NAME NANMAC New Users to Excel 8 September 2nd 05 07:26 AM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 1 June 22nd 05 01:12 AM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 05:16 PM


All times are GMT +1. The time now is 06:21 AM.

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

About Us

"It's about Microsoft Excel"