Thread: Kill file
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
[email protected] halimnurikhwan@yahoo.com is offline
external usenet poster
 
Posts: 113
Default Kill file

Hi,

Just makse sure you're using the match application version ...!
in XL 2003 is supported, but don;t know in the earlier ....

Thanks,
halim

EW menuliskan:
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 error 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