Thread: Kill file
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Kill file

how about just

Kill "C:\program files\ccapps\ttlview\WORK\Reports\*.tvr"


--
Regards,
Tom Ogilvy


"EW" wrote in message
...
I got the following error at the part:

With Application.FileDialog(msoFileDialogFilePicker)

"Object doesn't support this property or method"



"Die_Another_Day" wrote:

Sub KillTvrFiles()
Dim cnt As Long
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = True
.InitialFileName = "C:\program files\ccapps\ttlview\WORK\Reports\"
.Filters.Clear
.Filters.Add "tvr Files", "*.tvr"
.Title = "Please Select Files to be deleted"
If .Show = False Then Exit Sub
If MsgBox("Are you sure you want to delete all selected files?", _
vbYesNo, "Warning! Deleting Files") = vbNo Then Exit Sub
For cnt = 1 To .SelectedItems.Count
Kill .SelectedItems(cnt)
Next
End With
End Sub

Charles

P.S. Let me know if you want code to kill all .tvr files in that folder
and if you need help killng the warning messages.

EW wrote:
All--
I have a group of files that need to be deleted before running a macro.
The
files are all named something different but the extentions are all the
same
(.tvr). Here's the path: C:\program
files\ccapps\ttlview\WORK\Reports\

Any help would be great!

Thanks in advance